In what had been billed as the biggest Manchester derby ever, Kompany connected with David Silva's corner to score the decisive goal in first-half stoppage time at the Etihad Stadium. City then held on for a potentially title-deciding victory as it now leads United on goal difference and once again has matters in its own hands, having erased an eight-point deficit in a couple of weeks.
"Absolutely buzzing. ... We've been waiting for this moment," Kompany said. "It's far from over, and we know that, but just to give our fans two wins over Manchester United this season — we have to finish it off."
City still has a tough job to do as it next visits fifth-place Newcastle United and then hosts relegation-threatened Queens Park Rangers in the remaining fixtures, while United finishes against Swansea at home and Sunderland away.
"It's great to win tonight, but Newcastle is now our focus," City goalkeeper Joe Hart said.
After leading the Premier League for most of the season, City trailed United by eight points earlier this month but two more wins should now be enough to claim a first league title since 1968.
As the crosstown rivals have been locked in a two-way fight for the title for most of the season, this game had been hyped up as the most important ever played between the two sides. The entertainment level, however, was not nearly as high as the stakes.
The game featured few clear scoring chances for either side, and the tension on the pitch spilled over to the sidelines in the second half as United manager Alex Ferguson and City counterpart Roberto Mancini got into a heated exchange after a tough challenge by Nigel de Jong on Danny Welbeck.
With both managers making hand gestures to suggest that the other should stop talking, Ferguson eventually had to be dragged back to his own technical area, while City's assistant coach David Platt restrained Mancini.
"Sir Alex told me something not kind," Mancini said. "But i can understand, because at that point, tension is high."
Ferguson said he was upset that Mancini was yelling too much at the match officials.
With City under pressure to win, Mancini started with former United striker Carlos Tevez and Sergio Aguero up front, while volatile forward Mario Balotelli was on the bench.
Ferguson relied on experience after making four changes from last week's 4-4 draw against Everton. Ryan Giggs was recalled alongside Paul Scholes, with Phil Jones, Chris Smalling and Park Ji-sung also returning.
While United ventured forward in the opening minutes, it was City that controlled possession in the first half and went close in the 25th when Aguero volleyed off target from an angle. That chance had the City supporters on their feet — including Aguero's father-in-law, Argentina great Diego Maradona, who was watching from an executive box.
United seemed happy to soak up City's attacks knowing a draw would all but end City's title hopes, but that plan backfired in first-half stoppage time.
Silva whipped in a corner from the right flank and Kompany got away from Smalling to give City the lead with a firm header — ensuring that the teams went in for halftime with the home fans waving their blue-and-white flags above their heads in jubilation.
"I guess a lot of predictions go wrong, but I remember someone texting me today and saying 'You're going to score a goal today,' and I thought he was a lunatic."
Ferguson moved Park higher up the pitch to support Rooney in the second half, but the South Korean looked rusty and made little impact in his first league start since January.
Uncharacteristically, United failed to create clear chances and Hart had surprisingly little to do in the City goal.
United's frustration continued on the pitch as City's defence held firm, while Toure curled a left-foot effort just wide in the 82nd as gaps opened up in midfield.
Gael Clichy had a shot saved by David De Gea in the United goal in the 88th and Nasri thumped the turf in anger as he took too many touches before being tackled in front of goal in the 90th.
Five minutes of stoppage time was not enough for United to find a trademark equalizer and City's fans — including Maradona — erupted in celebration at the final whistle.