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.
arcus 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.
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.