Torquay dominated the first half, but the Millers went ahead early in the second period on Tuesday night thanks to Torquay keeper Michael Poke's slip.
Poke seemed to have Lee Frecklington's 46th-minute 20-yard strike covered but the ball squirmed up and over the diving keeper and in.
It was the spark Rotherham needed and forward Alex Revell raced down the left before slotting the ball past advancing Poke to make it 2-0 after 59 minutes with a clinical angled strike into the far corner.
Torquay pulled a goal back in stoppage time when Billy Bodin won and converted a penalty after being fouled by Mark Bradley.
The Gulls' joy was short-lived as Rotherham scored straight from kick-off as Kayode Odejayi tapped in a right-wing cross from fellow substitute Courtney Cameron to put it to bed.