Yaya Toure volleyed in the opener to give City hope of recording a first away win of the season.
Karim El Ahmadi's close-range finish levelled matters only for Edin Dzeko to head City back into the lead.
But Villa equalised through Leandro Bacuna's free-kick before snatching the three points when Andreas Weimann raced through and poked home late on.
The win was Villa's first at home this season and the second half performance will have given home fans plenty to be happy about - particularly the display of Dutch midfielder Bacuna.
The summer signing from FC Groningen provided the assist for Villa's first, while his equalising free-kick - his first Premier League goal - would have been difficult for any goalkeeper to keep out.
City had arrived at Villa Park looking to maintain the momentum built up from their impressive 4-1 defeat of Manchester United last weekend, a third successive home win in the Premier League.
But for all their dominance at the Etihad Stadium this season, they have been disappointing on the road.The home side's 3-5-2 formation was leaving them defensively fragile on the flanks and City repeatedly found spaces, with James Milner shooting wide while Samir Nasri's deflected shot flew just wide of the upright.Manuel Pellegrini's side had taken just one point from a possible six prior to travelling to Villa but a first away win looked promising for the visitors as they dominated early on.
City keeper Joe Hart had little to do in a first half Villa rarely managed to threaten in. The closest they came to scoring was a 25-yard free kick by El Ahmadi which sailed over the bar.
Ciaran Clark kept Villa in the game with a goal-line clearance from Toure's effort as half time approached, but the midfielder was not to be denied his sixth of the season soon after.
A corner was whipped in by Nasri and though the ball was headed away from goal, it went only as far as Toure who hit a first-time volley underneath the dive of Guzan.
It was a lead the visitors fully deserved, but Villa were level just five minutes into the second half. Bacuna, 22, slipped a smart ball to send El Ahmadi clear and though the Morocco international appeared offside, the flag stayed down as he fired past Hart.
Villa's delight was shortlived as City regained the lead minutes later, Dzeko powering a header past Guzan from Nasri's corner.
Facing the prospect of a third successive home defeat, and having twice gone behind, Villa could easily have given into City but instead they grew into the game.
Captain Ron Vlaar volleyed into the hands of Hart from Vincent Kompany's poor clearance before the hosts were presented an even better chance to equalise when they were awarded a 73rd minute free-kick 25 yards out. They took full advantage as Bacuna confidently stepped up to curl a sublime effort that gave Hart no chance.
Three minutes later, and with City still regrouping from that equaliser, Villa were gifted a decisive third goal.
Kompany and Matija Nastasic allowed Guzan's delivery to bounce and Weimann took full advantage, racing towards goal before poking the ball beyond the onrushing Hart and into the net to seal a dramatic victory which lifts Paul Lambert's side up to ninth in the Premier League table