The Red Devils staged a stunning second half comeback from 2-0 down to eventually win the game 3-2.
Paul Pogbas brace drew United level before Chris Smallings header completed an unlikely comeback.
Goals from Vincent Kompany and Ilkay Gudogan had put City firmly in the driving seat and on the verge of clinching the Premier League title in front of their local rivals.
But, the second half collapse condemned Pep Guardiolas men to their second defeat in a row and handed over the local bragging rights to United.
It was an electric encounter and it seems even Citys own stewards at the Etihad got caught up in the drama.
When Smalling headed in Alexis Sanchezs freekick in the 69th minute, TV cameras picked up a City steward subtly celebrating the goal.
United are now on track to claim second place in the Premier and Jose Mourinho hopes his side will be able to challenge City for the title next season.
We moved the ball more than any team has against Manchester City. We pressed a bit higher and we kept the shape to get a good result, Mourinho said.
I think mathematically we need six points to stay in the top four and this win is part of that.
Our challenge is to finish second but I want to congratulate City for the title – because they are going to win and deservedly. They gave no chance to the others because they had this season of not stopping winning.
My objective here was to get points and not spoil any celebrations. The point is can we improve enough to catch them next season?
More: Manchester United FC