The hosts took 90 seconds to take the lead when Olivier Giroud flicked the ball to Rafael Leao, who surged into the box and calmly placed it in the net.
Fiorentina could have equalised after eight minutes when Cristiano Biraghi was played free, but his shot from an acute angle hit the post and bounced out.
One minute into stoppage time, Ante Rebic sent a cross into the box, with Milenkovic miscalculating and directing the ball into his own net.
Milan are second with 33 points as they go into the World Cup break, with third-placed Lazio playing later on Sunday. Fiorentina are 10th with 19 points.