Adam Le Fondre and Ben Pringle struck for the Millers, but Byron Moore netted for the hosts to set up a grandstand finish, though United hung on to triumph at Gresty Road.
The home side looked bright, Lee Bell side-footing the wrong side of the upright, before Rotherham took the lead in the 15th minute when Le Fondre lost Carl Martin to nod in Lewis Grabban’s cross.
Moments later, Martin was in the right place to hack Danny Schofield’s low centre to safety. Steve Phillips then produced an athletic fingertip save to palm away Le Fondre’s stunning 25-yard effort while Ajay Leitch-Smith kept Ryan Cresswell’s header from crossing the line.
The Millers did double their lead in the 72nd minute when Dave Artell gave the ball away to substitute Pringle, whose 35-yard shot beat Phillips via a deflection.
Moore pulled one back for the Alex two minutes later, slotting Miller’s cut-back low into the far corner. And Crewe almost got the equaliser their play deserved when Conrad Logan parried Ashley Westwood’s long-rage strike into the path of Miller, but the visiting keeper stood firm to deny the forward and ensure Rotherham walked away with all three points.