Chris O'Grady was the Millers' double hero after coming on as substitute, hitting the 78th minute winner and then denying Wrexham an injury-time equaliser with a goal-line clearance.
The Dragons, who flirted dangerously with the drop into the Conference League last season, were booed off the field for the second successive home game after another below par display which is alarming their fans.
Michael Proctor might have steadied his team-mates' nerves in the first half but he completely mis-kicked a cross from Matty Done.
And in the second half, home substitute Chris Llewellyn forced a flying save from United's keeper Andy Warrington.
Moments earlier the quick moving Stephen Brogan almost broke the deadlock at the other end but his shot was brilliantly saved by home keeper Anthony Williams.
O'Grady's appearance gave the visitors fresh hope of getting something from the game and it was no surprise when, in the 78th minute, he was on hand to tap home a fine right-wing cross from Andy Todd.
Wrexham introduced Silvio Spann for his league debut and he soon forced a brilliant save out of visitors' keeper Warrington. From the resulting corner, it looked as though home skipper Neil Roberts had grabbed a face-saver until that man O'Grady cleared the ball off his own line.
Wrexham had shown little method in their play and the home attack made little impact. Rotherham looked the more physical side with Brogan a useful outlet being a handful on the flanks.
Wrexham boss Brian Carey said: "I am bitterly disappointed. Chances came along and we didn't take them. Everyone is frustrated including myself. It's not nice looking at the League table at the moment."