The Argentina defender struck in the second half after Marcus Rashford cancelled out David Silva's opener, ensuring a record-equalling 14th win in a row in the top flight for Pep Guardiola's side.
Much had been made before the game of City's vulnerability from set-pieces and it was a curious quirk of fate to see them triumph at Old Trafford for the second year in a row by virtue of two dead-ball situations.
United took a 40-game unbeaten home run, including a 100 per cent record this season, into the match, but City were the dominant force from the outset and deserved the lead Silva secured in the 43rd minute.
Marcus Rashford capitalised on some slack defending to draw United level, but the hosts were punished for failing to clear the lines again nine minutes after the break, as Otamendi finished in style.
United were denied twice at the death by Ederson and the result leaves them with a daunting gap to their neighbours, who look to be on an unstoppable march towards the title after only 16 matches, with Guardiola also enjoying the bragging rights over Jose Mourinho.
2 – Manchester United have conceded two goals at Old Trafford in the Premier League for just the second time under Jose Mourinho (also conceding two v Man City in September 2016). Flashback.— OptaJoe (@OptaJoe) December 10, 2017
Perhaps unsurprisingly, City dominated possession in the early exchanges against a United side who lined up with Rashford, Anthony Martial and Jesse Lingard all in support of striker Romelu Lukaku.
City's first chance fell to Raheem Sterling, who shot straight at David de Gea, before Gabriel Jesus produced a similarly tame finish after surging clear into the penalty area past Marcos Rojo.
Jesus incurred the wrath of Mourinho when he went to ground under little contact in the United area, but it was the home support who appeared most frustrated with the half as they watched their side sit deep and offer next to nothing in attack.
De Gea made his first real save of note four minutes before the interval, tipping over Leroy Sane's effort from close range, but it proved a futile piece of agility as City snatched the lead moments later.
Lukaku misjudged his header from the resulting corner and the ball fell kindly to Silva, who prodded home from inside the six-yard box.
The goal seemed to spark United into life suddenly, with Martial at last testing Ederson, and they snatched an equaliser in first-half injury time when Rashford pounced on Fabian Delph's failure to clear and slotted home from 12 yards out.
But City regained their lead nine minutes into the second half in remarkably similar fashion to their opening goal. Lukaku's attempted clearance from Silva's free-kick went straight against Chris Smalling and fell to Otamendi, who steered the ball acrobatically into the net.
4 - Nicolás Otamendi has scored more Premier League goals this season than any other defender (4). Danger. pic.twitter.com/aByDBO0Jhq— OptaJoe (@OptaJoe) December 10, 2017
City's control of the ball showed no sign of waning and De Gea was called upon to make a fine low save to deny Kevin De Bruyne, although Rashford stung the palms of Ederson after another Delph error as Mourinho turned to substitute Zlatan Ibrahimovic for hope.
Ederson pulled off a brilliant double save to deny Lukaku and Juan Mata six minutes from time, depriving United of a second equaliser and putting the title race firmly in City's grasp as they became the first side to win 14 consecutive top-flight games in a single season.
Key Opta Facts:
- Manchester City have won their last 14 league games in a row – the most by a team in a single English top-flight season.
- Indeed, City's 14-game winning streak is the joint-best-ever in the English top-flight alongside Arsenal's run between February and August 2002.
- This was just the second time a team has scored more than one goal in the Premier League at Old Trafford against Jose Mourinho’s Manchester United (also City in September 2016, 2-1).
- Jose Mourinho has lost nine matches in all competitions against Pep Guardiola, more than against any other manager.
- Five of David Silva's six Premier League goal involvements against Manchester United have come at Old Trafford (three goals, two assists).
- Marcus Rashford has been involved in 11 goals in 12 games in all comps at Old Trafford this season (6 goals, 5 assists), more than any other United player.
- Nicolas Otamendi is now the top scoring defender in the Premier League this season (4).