Inter Milan had briefly climbed to the Serie A summit after their 3-1 success at Spezia earlier on Friday, putting pressure on their great rivals to respond as Milan look to win the Scudetto for the first time since 2011.
- ESPN+ viewers' guide: LaLiga, Bundesliga, MLS, FA Cup, more
- Don't have ESPN? Get instant access
Without a goal in their previous two league games, Milan did not take long to get on the score sheet in the San Siro, with Pierre Kalulu picking out the perfect cross for Leao to volley home in the 11th minute.
But they again fell flat in the second half, struggling to find that killer second goal, with Genoa causing problems down the other end.
Milan kept coming and finally made one count as Brazilian midfielder Messias hammered home three minutes from time to seal the win.
After securing their first win in three league matches, Milan moved onto 71 points from 33 matches, two clear of Inter who have a game in hand. Genoa remain 19th on 22 points, three points from the safety zone.
"The tension is felt, the pressure rises," Pioli told DAZN. "I told the guys that last year there was tension because we didn't know whether we could finish in the top four.
"Now the pressure is there but it must lead to positive energies because we are fighting for a goal [the title] that when we started working together we could not have imagined.
"For many of us it is the first time fighting for the Scudetto but we want to be winning again and this experience will prove useful in the future as well."
Goals had been hard to come by of late for Milan. Prior to successive 0-0 draws in their last two matches, Pioli's side had only managed four strikes in their previous five games in all competitions.
Leao is one of several out-of-form strikers, but showed no lack of confidence when he fired his first goal since the end of February into the net.
The hosts should have had another later in the first half, but Belgian midfielder Alexis Saelemaekers missed his kick with the goal at his mercy.
Veteran striker Olivier Giroud saw one acrobatic second-half effort flash wide, but otherwise that final pass again was eluding Milan until the dying moments.
Substitute Ante Rebic turned provider for Messias, who converted from the rebound after his initial effort had been saved.
Defensively it was another successful night for Milan. Pioli is now only the third manager in the club's history to keep a clean sheet in at least six games in a row in a single Serie A season.