A calamitous miskick by Villa goalkeeper Brad Guzan allowed Sergio Aguero to put City ahead in the third minute and Aleksandar Kolarov extended the hosts’ lead with a 66th-minute free-kick.
Villa hit back through Tom Cleverley and Carlos Sanchez, both of whom punished errors by City goalkeeper Joe Hart, only for Fernandinho to claim victory with a back-post finish from Kolarov’s left-wing corner.
The win left Manuel Pellegrini’s side nine points below leaders Chelsea, having played two games more, and above Arsenal and Manchester United.
Arsenal, a point back with two games in hand, visit Chelsea on Sunday, while fourth-place United travel to Everton.
It was a cruel outcome for Tim Sherwood’s Villa, victorious against Liverpool in last weekend’s FA Cup semi-final, and left them two points above the relegation zone, having played a game more than the three teams directly below them.
Earlier, Liverpool failed to make ground on the Champions League places after drawing 0-0 at West Bromwich Albion in captain Steven Gerrard’s 500th league game.
Ahead of Sunday’s matches, Brendan Rodgers’s team are seven points below the top four in fifth place, but they remain in pole position in the Europa League qualifying race after Tottenham Hotspur drew 2-2 at Southampton.
Graziano Pelle twice put Southampton in front at St Mary’s, put Spurs hit back on both occasions, first through Erik Lamela, who appeared to score with his arm, and then via Nacer Chadli.
“I was focused on my job, but it was a very tough and emotional game for me,” said Spurs head coach Mauricio Pochettino, who left Southampton last year.
“It was difficult because I still love Southampton and I have very good memories here.”
Tottenham, sixth, trail Liverpool on goal difference and remain a point above Southampton.
The teams finishing fifth and sixth will qualify for the Europa League, while victory for Arsenal over Villa in the FA Cup final would also send the team finishing seventh into Europe’s second-tier competition.