Twelve-time FA Cup winners United were below par as they followed up last week's Premier League defeat at Arsenal with a meek exit at Molineux.
Pep Guardiola's men looked to be heading out of the competition at the hands of second-tier opposition, but three goals in the final 21 minutes saw City come back from the brink, as Aguero - who appeared to be offside - nodded in the late clincher.
Guardiola said: 'If it is not a penalty, and it is offside like the people say, I'm sorry.
Aguero missed a glorious chance to score but the Argentine striker had the final say when he headed the victor two minutes from time from what looked an offside position. "But the spirit and persistence helped us to win the game". "Hopefully next season this won't happen", City boss Pep Guardiola told BBC Sport.
The Premier League leaders mounted a stunning recovery to overcome the daunting deficit after Sterling and Aguero entered the fray either side of the hour mark but the win was achieved in controversial circumstances with the equaliser and Aguero's victor hotly disputed.More news: Bangladesh cricketers arrive home after Christchurch massacre
More news: New Line Cinema Sets Sopranos Prequel Film For September 2020
More news: India to host Federation Internationale de Football Association U-17 Women’s World Cup 2020 next year
After Bernardo Silva's superb finish with the outside of the boot got his side a foothold in the match, Aguero was presented with the flawless chance to draw City level after Sterling had been felled in the penalty area.
Police match commander Supt Steve Jones said the safety of supporters, players, officials and those who work at these games was "paramount". City knew their luck was in after Aguero's spot-kick went in off the back of Nordfeldt but the keeper then brilliantly denied Aguero from close range.
The Red Devils were handed a red card following a reckless challenge by Victor Lindelof on 83 minutes, but the Video Assistant Referee overturned decision and the defender was only handed a yellow card.
"They asked all the clubs if they want VAR and we said we want VAR all season". I don't like to win in that way.