With eight minutes left on the clock, Leao latched on to a misplaced pass from Fiorentina goalkeeper Pietro Terracciano and strode towards the goal before firing in a low effort to keep Milan in the hunt for their first league title in more than a decade.
Stefano Pioli's side have 77 points from 35 games, five more than Inter Milan who can cut that gap with a win at Udinese later on Sunday.
After a goalless first half during which Milan failed to hit the target, the hosts missed a gilt-edged chance to go ahead when Leao skied his shot from close range two minutes into the restart before Theo Hernandez's half-volley also sailed over.
Milan found themselves in promising positions down the left side but failed to force Terracciano into any notable saves and were lucky to not have Hernandez sent off after the Frenchman swung an elbow at Lucas Martinez Quarta.
Fiorentina almost grabbed a shock lead in the 75th minute but Arthur Cabral's header was brilliantly kept out by Mike Maignan before Leao made up for his earlier miss by calmly slotting past Terracciano.