The defeat will leave a huge question mark over the future of manager Giampaolo, with reports in Italy claiming he would be sacked were they to lose on Sunday night.
Gennaro Gattuso – who Giampaolo replaced as manager in the summer – Claudio Ranieri and Luciano Spalletti are already among the names reportedly being lined up to replace him, with Milan now languishing two places and one point above the relegation zone.
French veteran Ribery then pounced on a mistake by Hakan Calhanoglu and danced between two defenders before forcing a fine save from Donnarumma.
The visitors did not have to wait long to take the lead, after Ismael Bennacer brought down Chiesa in the area in the 14th minute.
Bennacer was shown a yellow card and Erick Pulgar coolly tucked away the spot-kick, sending Donnarumma the wrong way.
But Fiorentina had a goal disallowed when Chiesa pulled the ball across for Gaetano Castrovilli to fire in off the underside of the crossbar, only to be hauled back for offside.
Calhanoglu's shot was repelled by Dragowski before Milan were booed off at half-time.
Things got worse 10 minutes into the second half when Musacchio went in studs up on Ribery's shin.
The Argentina defender was initially shown a yellow card, but it was upgraded to red after a VAR review.
Donnarumma had to palm away a fierce long-range drive from Pulgar before the keeper got a hand to Chiesa's cross, only for Castrovilli to snaffle the rebound.
Fiorentina were awarded another penalty when Bennacer tripped Castrovilli, but Chiesa saw his spot-kick saved by Donnarumma.
However, Ribery tucked away the third with the Milan defence missing in action again and, although Rafael Leao pulled one back, the hosts could not prevent a hugely damaging defeat.