The 23-year-old latched onto fellow substitute Courtney Cameron's pinpoint delivery to power home the winner and the only goal of the game for Rotherham nine minutes after coming on for Michael O'Connor.
However there was an element of good fortune in the goal as Agard's header hit the post and bounced in off the Dons veteran keeper Neil Sullivan.
The struggling home side had the better of the first half with Steven Gregory heading into the side netting and Will Antwi almost bundling over a Stacy Long corner.
Rotherham striker Daniel Nardiello almost made them pay for their misses 12 minutes after the break after a weak punch from Sullivan fell to him unmarked deep in the area.
The Welshman could only fire wide while almost immediately after Toby Ajala brushed three Rotherham defenders to one side but opted to shoot instead of feeding Jack Midson.
Sullivan then spilled a shot from Nardiello before being involved again when Agard headed home the winner.