Connor Wickham came off the bench to spare Sunderland's blushes as the Premier League side blasted four goals inside 18 minutes to see off MK Dons 4-2.
The League One side appeared to be heading into the Capital One Cup third-round draw after taking a deserved 2-0 lead with the Black Cats in tatters.
However, with the home fans voicing their disapproval, manager Paolo Di Canio sent on Wickham in place of the hapless Ji Dong-won and ultimately saw his move pay off.
Patrick Bamford on loan from Chelsea, had blasted the visitors into a seventh-minute lead with his third goal in four games, a rasping long-range drive.
It could have been even worse for the Black Cats, who needed keeper Vito Mannone to keep out a glancing header from team-mate Cabral and enjoyed a rare slice of good fortune when striker Izale McLeod fired just wide inside a turbulent opening 20 minutes.
But they did fall further behind within 10 minutes of the restart when Izale McLeod produced the cheekiest of finishes to extend his side's lead and put them within touching distance of victory.
A much-changed Sunderland, who misfired badly for much of the contest, gave themselves a lifeline with 12 minutes remaining when Jozy Altidore made the most of Wickham's through-ball to claim his first goal for the club, but the fireworks had only just begun.
Wickham dashed MK Dons' hopes of hanging on to their lead when he converted full-back Ondrej Celustka's cross four minutes from time and the tie looked to be heading into extra-time.
But the Ipswich striker snatched even that crumb of comfort from Karl Robinson's men when his 89th-minute shot deflected off defender Ben Reeves and flew past wrong-footed keeper Ian McLoughlin.
In the space of 11 minutes, the mood inside the Stadium of Light had altered dramatically, and there was more to come for the home fans six minutes into added time when Adam Johnson cut in from the right and drilled home a fourth from the tightest of angles.
Writing in his programme notes before the game, Di Canio, who had earlier forecast that his team would face a difficult test against a strong League One side, voiced the opinion that "to change six or seven players is too much", and then promptly made six changes to the side which drew 1-1 at Southampton at the weekend.
He may have wished he could overhaul significantly once again at the break after seeing the Black Cats play second fiddle to the visitors for long periods.
Indeed, having taken a seventh-minute lead when Bamford accepted Dele Alli's pass, switched it to his left foot and then smashed a long-range effort past debutant Mannone, they threatened to increase it on more than one occasion.
For their part, Sunderland created little of note, despite right winger Johnson and striker Altidore causing problems, with midfielder David Moberg-Karlsson and Ji in particular struggling to make an impact.
But the Swede might have marked his first competitive appearance with an equaliser after Altidore's 44th-minute shot had come back off a post, only to miss his kick and then head tamely at keeper Ian McLoughlin from the rebound.
Whatever he said in the dressing room at half-time, Di Canio sent out the same 11 men for the second half and saw them almost fall further behind with barely a minutes played.
Bamford caused problems down the right once again before laying the ball off for skipper Gleeson to blast a right-foot drive inches over the angle of crossbar and post.
Ji's departure was far from mourned by the home fans, but things took an even uglier turn for the home side within six minutes when Samir Carruthers pounced on Cabral's loose ball to play McLeod through the heart of a static defence and he raced away before audaciously chipping over the advancing Mannone and into the empty net to make it 2-0.
But, having seen Moberg-Karlsson and Wickham pass up glorious opportunities, Altidore struck to spark the late onslaught before handing to the baton to Wickham to win the game.
Johnson's injury-time strike served to erase the memories of much of what had gone before as Sunderland claimed a first victory of the season by inflicting the visitors' opening defeat.