Gus Poyet's team had been on the verge of defeat at the Stadium of Light after goal-line technology was used for the first time in the League Cup to give Chelsea the lead through Lee Cattermole's own goal in the opening minute of the second half.
But Fabio Borini equalised for the Premier League's bottom club in the 88th minute and Ki sent Sunderland into the semi-finals with a cool finish two minutes from the end of extra-time.
It was Ki's first goal in 13 appearances for the Black Cats since his loan switch from Swansea, with whom he won the League Cup last season, in September.
Ki had never scored in English football since moving to Swansea from Celtic in 2012, and this was his first club goal since he netted for the Scottish giants at Hibernian in February 2012.
It was a dispiriting night for Blues boss Jose Mourinho, who won the League Cup twice in his first spell in charge of the west London club but saw his fears about his shot-shy team confirmed during a lacklustre display.
Mourinho made eight changes following Saturday's 2-1 win over Crystal Palace.
And, after struggling to find any rhythm in a tepid opening 45 minutes, Chelsea took the lead less than 60 seconds after the break.
Frank Lampard was challenged by Cattermole near the goal-line as the pair competed for Cesar Azpilicueta's low cross and the ball rolled into the net.
Sunderland goalkeeper Vito Mannone tried to claw the ball out from behind the line, but the goal was correctly given, with referee Anthony Taylor pointing to his watch to indicate goal-line technology had been used to confirm the decision.
It was the first time goal-line technology had been used in the League Cup, although the system was established in the Premier League at the start of this season.
Samuel Eto'o should have doubled Chelsea's lead soon after, yet the Cameroon forward's poor form for the Blues continued as he shot well wide with just Mannone to beat.
And Sunderland took advantage of that escape to equalise when on-loan Liverpool striker Borini fired home from an acute angle after a driving run from Jozy Altidore.
Ki was denied by Mark Schwarzer's fine save as Sunderland dominated extra-time, but he eventually sealed the win with a clinical low strike from Borini's pass.
At the King Power Stadium, City were effectively through to the semi-finals by half-time as they finally took their free-scoring home form on the road.
City boss Manuel Pellegrini made eight changes to the team that thrashed Arsenal 6-3 at Eastlands on Saturday.
But the Premier League title challengers were on top right from the start and took the lead in the ninth minute when Serbian defender Aleksandar Kolarov whipped a fine 25-yard free-kick into the top corner of Kasper Schmeichel's goal.
There was a setback for City moments later as Argentine right-back Pablo Zabaleta was forced to come off with a hamstring injury.
Leicester sit third in the Championship yet they offered minimal resistance and City increased their lead in the 41st minute.
It was a sweeping move as Jesus Navas teed up James Milner and the England winger's cross picked out Dzeko, who headed home emphatically from close-range.
Bosnian striker Dzeko struck again in the 53rd minute, this time scuffing his shot past Schmeichel from another Milner cross.
Leicester replied in the 77th minute through Lloyd Dyer's deflected shot, but City, who haven't reached the League Cup final since 1976, were never in danger of blowing their lead.
On Wednesday, the other two quarter-finals see Tottenham host West Ham in the north London club's first match since the sacking of manager Andre Villas-Boas on Monday, while Manchester United travel to Stoke.
Spotted: Sangeeta Bijlani at store launch in Bandra
Photos: Ajay Devgn and his girl gang promote 'Shivaay'
Irfan Pathan's birthday: Popular brother duos in international cricket
Kumar Sangakkara birthday: Batsmen who hit the most Test double tons
Birthday special: 21 actresses who married businessmen