Mason Greenwood netted the winner deep into stoppage time to send the visitors through to the knockout stage with a perfect record – a reminder of times when the Red Devils regularly enjoyed late winners.
Rovers had taken the lead courtesy of a fortuitous effort from Alfie May just after the hour mark before Ethan Galbraith equalised with a stunning volley.
Doncaster can still reach the last 32 if Rotherham United lose at Lincoln next month in the final game in Group H – but it will depend on goal difference.
“I thought we made the game a lot harder than it needed to be in the end,” said Rovers manager Darren Moore afterwards.
“We started bright and could’ve been two or three goals to the good after 15 minutes. We moved the ball around and they found it difficult the speed and the tempo that we set.
“We’re disappointed to lose the game having been in the lead but we have to take it on the chin. We’ve ended up losing a game which I didn’t see coming.”
Doncaster Rovers: Lawlor, Halliday, Wright, Daniels, James, Whiteman (Sheaf 46), Gomes, May, Kiwomya, Ennis (Sadlier 46), Thomas (Watters 69). Unused substitutes: Dieng, Anderson, Longbottom, AJ Greaves.
Manchester United: Kovar, Laird, Mengi, Bernard, Devine, Puigmal (Helm 77), Galbraith, Ramazani (Elanga 86), Mellor, Chong, Greenwood. Unused substitutes: Woolston, Taylor, Fish, Hoogewerf, McGhee.
Referee: Alan Young