The Viola came from behind to snatch victory thanks to an injury-time winner from the substitute
Fiorentina came from behind to stun Inter 2-1 thanks to El Hadji Babacar’s 91st minute strike.
The substitute turned in a rebound after Samir Handanovic fumbled a shot by former Inter striker Mauro Zarate to seal a dramatic late win.
Fiorentina had earlier trailed to a Marcelo Brozovic strike, but Borja Valero levelled with a header before Boubacar’s late heroics.
The game also saw three red cards produced by referee Paolo Mazzoleni late on at Stadio Artemio Franchi as Alex Telles, Mauro Zarate and Geoffrey Kondogbia were all dismissed.
The result sees Paulo Sousa’s men climb to third in the table, with Inter remaining in fifth.
Former Fiorentina coach Roberto Mancini recalled Miranda after the defender served a one-game ban, while the hosts were without the injured Tino Costa and the suspended Matias Fernandez.
La Viola had won their last three meetings with Inter and they almost got off to the perfect start when Ilicic strode forward and hit a firm drive, with Slovenia international goalkeeper Samir Handanovic saving smartly with his legs from his compatriot’s effort.
Fiorentina dominated the early exchanges and almost took the lead after 14 minutes when Ilicic beat Handanovic with a low strike, but Telles got back to clear the effort off the line.
Jeison Murillo then had a terrific chance for Inter, but his diving header flew well wide of the post.
Fiorentina could have had a penalty in the 21st minute, but when Federico Bernardeschi got clear and fell under a challenge by Miranda after a smart one-two with Nikola Kalinic, Mazzoleni awarded a foul against the attacker.
That decision proved key as Inter soon took the lead against the run of play. Kondogbia freed Palacio in the box and Brozovic ran on to the cutback to slam a shot high into the net.
Fiorentina came close to an equaliser on the stroke of half-time, Handanovic clawing away a looping header by Matias Vecino from underneath the crossbar.
The hosts, unbeaten in their last four matches, scored the goal their excellent play deserved just before the hour-mark, Valero nodding home a deflected Ilicic cross at the back post.
Fiorentina then had another big penalty appeal when Telles handled a cross in the box, but again referee Mazzoleni was unmoved.
Inter had won just one of their previous six league games and Mancini’s men rarely threatened in this one. After Telles received a second yellow card for bringing down Bernardeschi, Fiorentina found a deserved winner.
Handanovic spilled Zarate’s shot at the feet of Babacar and the striker bundled the ball home with the aid of a deflection. Zarate was later sent off for clashing with Murillo.
Kondogbia was also shown a red card after the final whistle for sarcastically applauding the referee to compound a miserable match for Mancini’s men.