Two goals in the first five minutes got the game off to a cracking start.
Daniel Nardiello opened the scoring for the hosts with his 20th goal of the season - Alex Revell chased down an Alan Goodall back pass and goalkeeper Scott Davies cleared straight to the Millers' leading scorer who tucked the ball into the unguarded net.
Nardiello went down under a heavy challenge and limped off with eight minutes played, by which point Fleetwood were level.
Former Rotherham winger Gareth Evans did the hard work on the left, crossing for Junior Brown who completely scuffed his shot but the ball fell kindly to David Ball who slotted home from close range.
Moments later, Ball went close again when a deflected shot flashed wide before the hosts responded.
Kieran Agard should have scored after 29 minutes but steered his shot wide and Lee Frecklington's shot was diverted past the post by Cod Army defender Shaun Beeley.
Concerted Rotherham pressure after the break saw them retake the lead after 62 minutes.
Ben Pringle's shot was blocked but the ball spun to Agard who fired home from close range to seal a crucial win.
Source: PA
Source: PA