The Millers travelled to London effectively needing to win all of their remaining six fixtures to break into the top seven and Ben Pringle set them on their way after 34 minutes.
Luke Moore thought he had secured the Dons a point 20 minutes after the break but Hoskins, who replaced Pringle in the 81st minute, had other ideas as he netted the winner moments later.
Lewis Grabban and Gareth Evans both had chances to put Rotherham ahead – the former firing straight at Jack Turner early on and the latter somehow failing to connect after 25 minutes.
George Moncur turned and shot wide in response for the hosts but the Millers deservedly took the lead 11 minutes before the break when Pringle’s low drive from 35 yards beat Turner.
The Dons equalised after the break, with Moore finishing off Jack Midson’s pass on the counter, and despite the same player clearing off the line moments later it was left for Hoskins to hit a lofted winner late on.