Best known for winning the French Open in 1998, Moya won his ninth career title, eight of which have come on clay.
"It was a very exciting match and I played well to win," said Moya, who improved to 30-6 on clay this year and earned the $48,850 first prize. "I won the first set fairly easily and then he started taking more risks. In the third I started to have trouble with my back and I didn't think I could win. Mentally, it was a very exhausting match."
El Aynaoui was participating in his career-best fifth final of the year, having won titles in Doha, Casablanca and Munich. He had won just two ATP finals in a 12-year career before this season.
It was only the second meeting between the two in an ATP event. Moya rallied to beat El Aynaoui in their round-of-32 matchup at the 2000 Toulouse hardcourt event.