Millers pipped by Blues
Two down at half time, they looked a transformed side after the break and despite a quick reply from Matt Derbyshire, they were unable to force an equaliser.
Millwall's win against Charlton means Steve Evans’ men remain four points above the Championship safety line with six games to go.
They hardly laid a glove on the home side in the first half despite looking relatively comfortable for the first 20 minutes.
When Robert Tesche steered the Blues into the lead from the edge of the penalty box just before the half-hour mark, they got on top and the advantage was doubled two minutes before half time.
Emi Martinez could only parry David Cotterill’s driven free-kick and Clayton Donaldson headed in the rebound.
After a half-time talk from Steve Evans, Rotherham came out for the second half in much more determined mood and pulled a goal back three minutes in.
Connor Sammon drove into the box and the ball broke for Derbyshire to mop up from close range.
The goal changed the pattern of the game as Birmingham were finally forced to defend.
A strong penalty claim for a crude challenge on Derbyshire was waved away by referee Dean Whitestone and the striker was also unlucky to see a header bounce across the goal face.
However despite the pressing it took two good stops by Martinez from Tesche in stoppage time to prevent further damage in what was the Millers' fourth straight defeat.
Millers: Martinez, Hunt, Lafferty, Morgan, Broadfoot, Smallwood, Sammon (Yates 86), Wilson (Bowery 52), Smallwood (Newton 63), Frecklington, Pringle, Derbyshire
Birmingham: Randolph, Grounds, Gleeson, Tesche, Kiernan, Shinnie, Morrison, Caddis, Gray, Donaldson, Cotterill
Referee: Dean Whitestone (Northants)
Attendance: 16,569 (1,112 visitors)