Menez, so often Milan's stand-out player in a testing season, took centre stage once again with seven minutes remaining to move Filippo Inzaghi's men within six points of fifth-placed Napoli.
Inzaghi reacted to Menez's superb finish with glee, racing down the touchline to celebrate with his players near the corner flag.
Palermo dominated much of the first half, but Milan went in ahead at the interval thanks to Alessio Cerci's 37th-minute opener.
Mattia Destro had two chances to double Milan's lead after the break but failed to take them, and the visitors were punished when Palermo's sought-after star Paulo Dybala converted a penalty 20 minutes from time.
The game looked to be heading for a draw, but Menez's intervention in the 83rd-minute earned what could prove to be a crucial three points for Milan.
Palermo's attacking trident of Dybala, Franco Vazquez and Robin Quaison provided a constant threat throughout the first half, and the hosts should have been ahead when the much-coveted Dybala created a golden opportunity for Vazquez.
As the Milan defence stood stationary, Dybala raced into the penalty area before pulling back to Vazquez, only for his fellow Argentinian to inexplicably miss an open goal from six yards.
Luca Rigoni and Quaison then both tested Milan goalkeeper Diego Lopez from the edge of the area, only for the visitors to take the lead against the run of play eight minutes before half-time.
Stefano Sorrentino failed to collect a low cross from the right, and Cerci was on hand to bundle his first Milan goal over the line.
Destro had a goal disallowed for offside shortly after the interval and, although Palermo's strikeforce was not as potent as before the break, they were gifted a way back into the game when Gabriel Paletta felled substitute Andrea Belotti in the area.
Dybala stepped up and unerringly fired his spot-kick beyond Lopez, and Palermo appeared set to take a point.
However, Milan remained a threat on the break and when Menez was sent clean through on goal, he made no mistake - firing high past Sorrentino from 18 yards to spark wild celebrations from a relieved Inzaghi.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1