Ansarifard scored in the 85th minute and Omonia won its 16th Cyprus Cup title.
He has scored eight goals in 40 matches for Omonia since joining the Cypriot team.
Omonia won its sixteenth Cup title, the second in a row, and is now closing in on APOEL who has 21 trophies and is the most successful club in Cyprus.