County had the better of the first half but Rotherham opened the scoring just before the break when Michael Smith poked home a low Ollie Rathbone cross.
The non-league side thought they had equalised in the second half only for Paddy Madden's header to be ruled out for offside and they continued to push for a leveller in the closing stages but the Millers held on to advance to the next round.
The victory stretched the Millers unbeaten run to 18 games but a large vocal following from Stockport cheered thier team on all the way and thier team was spirited by this.
As Dave Challinor's men searched for a goal, Rotherham looked dangerous on the break but were unable to double their advantage against a side 55 places below them in the league pyramid.