The confrontation took place after Rossi substituted Ljajic with 32 minutes gone and Fiorentina were 2-0 down.
They took the lead after eight minutes through Claudio Marchisio and dominated the play, creating several chances that went begging.
It looked like the win would be theirs until Buffon miscontrolled the ball under no pressure, giving it straight to Andrea Bertolacci who slotted into an open goal five minutes from time.
"Five minutes from the end, the championship appeared to be over... then Lecce scored and in the final minutes it felt like being at the theatre awaiting the end of an opera,' said Milan coach Massimiliano Allegri, with a huge grin.
"I'm enjoying myself lots, and now we go into the derby fired up. The title is still in Juve's hands, but having it all to play for on the final day wouldn't be bad."
Milan next face Inter Milan on Sunday in what promises to be a huge derby with the Nerazzurri fighting for a place in the Champions League. Juve take on Cagliari in a game being played in Trieste because of problems at the Sardinians' stadium.
Lecce, who had Juan Guillermo Cuadrado sent off on 54 minutes, are three behind
Third spot is worth a place in the Champions League play-offs while fourth this term is only good enough for the Europa League.