The CONCACAF Gold Cup semi-finalists scored three times in the first half to claim the impressive victory at the MetLife Stadium.
Jose Manuel de la Torre's men capitalised on two defensive mistakes by the Ivory Coast in the first half.
Arthur Boka scored an own goal and Oribe Peralta netted a brace before a much-improved Ivory Coast pulled a goal back through Didier Drogba on the hour mark.
Angel Reyna added to the scoreline with a late effort.
It was good preparation for Mexico, who face Honduras and the United States in vital World Cup qualifiers in September.
Mexico sit third in the fourth round of CONCACAF qualifying and can cement their spot in the top three with two wins.
After a strong start, they were handed the opener by the Ivory Coast in the 11th minute.
Boka gave Boubacar Barry no chance as he diverted a cross past his own goalkeeper and into the bottom corner.
Peralta scored the first of his two goals on 28 minutes after a dreadful back pass from Jean-Jacques Gosso.
Gosso's pass lacked power and was well read by Peralta, whose first-time effort went into the roof of the net from just inside the area.
When he completed his brace in first-half added time, the result was decided.
After a neat team move, Giovani dos Santos crossed for Peralta to head in from close range and make it 3-0.
Drogba, who came on at half-time, pulled a goal back for the Ivory Coast on 62 minutes, sending Jose de Jesus Corona the wrong way from the penalty spot.
But Mexico sealed an impressive win in additional time as Reyna clinically finished into the bottom corner.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.