Ji kept the race for the Premier League title wide open as City wasted their chance to establish a three-point lead.
The South Korea international came off the bench to launch 2012 in style on Wearside with an unlikely winner in the fourth minute of injury time, when he looked to be fractionally offside before slotting in.
His fellow substitute Micah Richards had hit the woodwork at the other end with just a minute of the 90 remaining, and with the Black Cats staging a valiant rearguard action.
But a day after Manchester United and Chelsea both slipped up at home, City were unable to take advantage despite creating a host of chances as they were shut out for the second successive game.
Sunderland goalkeeper Simon Mignolet kept out substitute Sergio Aguero's 59th-minute shot and striker Edin Dzeko saw a series of opportunities go begging on another frustrating afternoon for the leaders.
City manager Roberto Mancini, perhaps with one eye on Tuesday's home clash with Liverpool, had started with Aguero and David Silva on the bench and left Mario Balotelli out of the 18, but he was forced to bring on the star substitute pair in a desperate search for a winner.
Yet, had either Nicklas Bendtner or Stephane Sessegnon taken the chances which fell their way either side of the break, Sunderland might have been in front long before they did actually take the lead.
Black Cats manager Martin O'Neill had gone into the game without a specialist full-back as injuries tore his defensive resources apart, and the situation was to get worse long before the half-time whistle sounded.
Having already had to press midfielders Craig Gardner and Jack Colback into service at right-back and left-back respectively, he also had to draft in Mignolet for the first time since he fractured his nose and a eye-socket on October 29 as Keiren Westwood pulled out.
O'Neill was forced into a further change with just 26 minutes gone when centre-back Wes Brown pulled up and was replaced by Matt Kilgallon, making his first senior appearance for the club since May 2010.
In the circumstances, O'Neill could hardly have been more pleased with the way his distinctly makeshift defence battled its way to the break without conceding.
Had lone frontman Bendtner shown a little more composure, his side might have headed for the dressing room holding a lead.
Sunderland broke at pace from a third-minute defensive corner and Sessegnon slid the perfect pass into the Dane's run to put him in on goal.
Bendtner took the ball wide of goalkeeper Joe Hart, but crucially not wide enough and the England international was able to make an important block.
Hart had to make a smart save from James McClean's effort two minutes later, but as the half went on, it was a City side featuring six changes from the 0-0 draw at West Brom which began to dominate.
It was not until the half-hour mark had passed that they really made their presence felt.
Mignolet, who was wearing a protective face mask, made a point-blank 32nd-minute block to deny Dzeko, but was then grateful to see Gardner clear Samir Nasri's effort off the line seconds later.
Dzeko rattled the crossbar with a powerful drive 10 minutes before the break and then prompted a comfortable save from Mignolet from distance with two minutes of the half remaining.
But it was the home side who went close in injury time when Gardner blasted just high and wide as the Black Cats surged forward.
Mancini had seen enough and replaced defensive midfielder Nigel de Jong with Aguero at the break, although it was McClean who went close to breaking the deadlock when his 47th-minute cross flew just over the angle of bar and post.
Yaya Toure scuffed a volley wide seconds later after Mignolet had kicked Aleksandar Kolarov's cross away, and Pablo Zabaleta also failed to hit the target after being played into space by captain Vincent Kompany.
Mancini responded by sending on Aguero for Samir Nasri, and the visitors squandered another promising opening within seconds when Dzeko skied a shot high over the bar from Adam Johnson's cross.
City might have taken the lead in controversial circumstances with 59 minutes played when referee Kevin Friend allowed play to continue after Sessegnon went to ground under Kolarov's challenge.
Silva fed the ball to Dzeko, who dropped it off for Aguero to fire in a close-range effort which Mignolet managed to block.
But Sunderland should have been in front with 64 minutes gone when Sessegnon cut inside from the right and found himself with just Hart to beat.
The Benin international pushed his shot agonisingly wide of the far post with the outside of his right foot.
Richards went desperately close to a winner with a minute of normal time remaining when he headed the ball into the ground and saw it come back off the crossbar after Mignolet had parried Silva's shot.
However, the drama was not over and when Sessegnon stabbed the ball into Ji's path, he calmly rounded Hart to snatch three precious points.