The Viola are still searching for their first victory of 2013, while the win moves Rolando Maran's side up to 7th and within a point of their opponents.
Catania were without suspended duo Francesco Lodi and seven goal top scorer Gonzalo Bergessio, while Sergio Almiron and Giovanni Marchese missed out through injury. Fiorentina were without the injured David Pizarro once again and Mounir El Hamdaoui was on African Cup of Nations duty.
Pablo Alvarez and Castro sent early efforts wide for the home side, before Fiorentina hit the front midway through the first half. Manuel Pasqual's corner was only half cleared, giving him a second chance to cross. Everyone missed the ball except for Migliaccio, who stuck his head out to nod in at the far post.
It could have been two, but Legrottaglie picked Adem Ljajic's pocket just as the Serbian was about to pull the trigger from an advanced part inside the area. Stefan Savic then had to make a crucial block to stop Castro from shooting in a dangerous position.
Catania equalised five minutes after the restart. Neto was late to come for a free kick and Legrottaglie beat him to it to head the ball into the net.
Juan Cuadrado headed an effort off the turf and onto the cross bar, then Ljajic rattled the upright after curling his free kick over the Catania wall. Aquilani swept the rebound wide.
Mariano Andujar stayed alert to tip Cuadrado's dipping shot around the post. At the other end, Neto saved Castro's effort from distance, only to spill the ball for a corner.
Cuadrado and Luca Toni both had offside decisions go against them when they were in promising positions to score, before Aquilani talked himself into an early bath after complaining too much about a wayward challenge.
The ten men continued to pour forward looking for a winner. Stevan Jovetic went close from 30 yards, with his strike only just evading the target. Then came the sucker punch.
Pablo Barrientos found space down the right hand side and crossed for Castro to rise above Facundo Roncaglia and head over Neto into the far corner. Castro will have to wait to build on this strike as a costly stoppage time booking rules the forward out of next weekend's game at Napoli.
Catania: Andujar; Alvarez, Legrottaglie, Spolli, Capuano; (Ricchiuti 57) Bellusci, (Potenza 77) Biagianti, (Paglialunga 85) Izco, Castro, Gomez, Barrientos;
Fiorentina: Neto; Roncaglia, Gonzalo, Savic; Cuadrado, Aquilani, Migliaccio, Borja Valero, Pasqual; (Tomovic 82) Ljajic, (Toni 69) Jovetic
Goals: Migliaccio 22 (F) Legrottaglie 50 (C) Castro 88 (C)
Sent off: Aquilani 78 (F)