The pace of Agbonlahor, back in the side for the injured Emile Heskey, and the poise and passing of Gareth Barry was causing United all manner of problems.
But United were handed a lifeline when Milner passed the ball back to Brad Friedel, who picked the ball up, and the resulting free-kick in the area was cracked in by Ronaldo after Ryan Giggs had rolled the ball to him.
The goal settled United's nerves and they began to stroke the ball around with more confidence, but without really penetrating.
And Villa remained dangerous on the break, particularly through Agbonlahor, whose speed was a big problem for Neville.
Ashley Young's free-kick was tipped over by Edwin van der Sar as Villa threatened.
From another quick counter Villa deservedly restored parity, Barry's excellent right-wing cross powerfully headed into the bottom corner by Carew as Neville stood by helplessly.
Shortly after, Neville was switched with right-back Jonny Evans - but it had been a half-hour to forget for the United skipper.
O'Neill praises 'terrific' Villa
He would have felt better if Ronaldo's glancing header had gone either side of Friedel rather than straight at the keeper and given United a half-time lead.
Instead, Villa struck again on 58 minutes when Ronaldo was caught in possession and Villa moved the ball quickly to Carew, and his cross was headed in by Agbonlahor.
United's response was to bring on Macheda for Nani.
The young Italian, who signed professional terms with United in August 2008, hit a hat-trick for the reserves against Newcastle on Monday.
He appealed unsuccessfully for a penalty after he fell under challenge from Curtis Davies, then at the other end Davies was close to converting Ashley Young's free-kick.
United needed something special from somewhere and it came from Ronaldo, who picked up the ball on the edge of the box and fired a low drive into the bottom corner to drag his side level.
Neville hails 'brilliant' Macheda
The impetus was all with the hosts now and it took a fine save from Friedel to deny Fletcher from 12 yards.
Substitute Danny Welbeck was next to be thwarted by Friedel as he saw his shot saved at point-blank range.
But United were not to be denied and Macheda produced a moment of magic to win the game when he turned and curled a peach of a shot into the far corner.
Van der Sar, Neville, O'Shea, Evans, Evra, Nani (Macheda 61), Carrick, Fletcher, Ronaldo, Giggs, Tevez (Welbeck 87).
Subs Not Used: Foster, Park, Gibson, Martin, Eckersley.
Ronaldo 14, 80, Macheda 90.
Friedel, Luke Young, Cuellar, Davies, Shorey, Milner (Reo-Coker 76), Petrov, Barry, Ashley Young, Carew, Agbonlahor.
Subs Not Used: Guzan, Delfouneso, Knight, Salifou, Gardner, Albrighton.
Milner, Ashley Young.
Carew 30, Agbonlahor 58.
Mike Riley (Yorkshire).
BBC Sport Player Rater man of the match:
Federico Macheda 7.89 (on 90 minutes).
Please note that you can still give the players marks out of 10 on BBC Sport's Player Rater after the match has finished.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.