The Stanley defender fired home from 25 yards in the 83rd minute with Millers goalkeeper Conrad Logan still assembling his wall, leading the visitors to protest in fury but to no avail.
Rotherham defender Ryan Cresswell headed his side into a 38-minute lead after he rose highest from Danny Schofield’s corner to celebrate his first goal of the campaign.
Earlier, visiting defender Dale Tonge had cleared Craig Lindfield’s close-range effort off the line whilst striker Wes Fletcher also went close.
After the break, the Millers looked for the second with Stanley keeper Sean Murdoch staying low to deny Gareth Evans while Lewis Grabban headed over from a corner before Hessey came up with the goods late on.
Rotherham’s Tonge missed a great effort in injury-time, firing wide in a good position while Chris Holroyd had a last-ditch effort saved for the Millers.