Callum Hope's fine strike two minutes into stoppage time completed a second-half turnaround that left the Potters stunned at the final whistle.
Jack Nardiello and Kris Scott had given the City youngsters what looked a comfortable cushion, but Hope, his first of a brace, and a Mikail Mandron penalty set up the dramatic finale.
Both sides had plenty of opportunities in an open game, so a point apiece would have been a fair outcome, but Stoke were cruelly denied at the death and faced the long trip back to the West Midlands wondering what might have been.
They entered the contest in good form having won their last two matches against Tottenham Hotspur and Southampton, and were the better side in the opening period here.
Although Mandron should have put Sunderland ahead after just three minutes, City got into their stride soon after and Derice Richards should have done better after Jake Cook had won a 50-50 to present him with a chance inside the area.
The Potters went ahead on 27 minutes - a misplaced pass from the Sunderland central defender left Nardiello bearing down on goal, and after his initial shot was blocked by Jonny Maddison, the rebound hit City's forward and trickled over the line.
Ethan Robson should have levelled for the hosts just after the half hour but his effort hit the outside of the post, while Nardiello's cross-field run up the other end offered him the chance to try from distance, but his drive flew over the bar.
City were edging the possession stakes and Richards missed another chance on 39 minutes when his header drifted wide from Nardiello's cross.
Sunderland made a double change at the break, although it was Stoke who got the game's next goal only two minutes into the second-half.
Richards slipped in Scott in the right channel and he finished tidily at the near post, giving City's youngsters the two-goal advantage that they would've hoped to be enough to see the match through.
Richards himself then had another header that went close, before he brushed the post with a left-footed shot after a good move involving Scott and Nardiello.
The Black Cats grabbed the game by the scruff of the neck, though, and Potters stopper Dale Eve was forced into two fine saves from Lindon Gooch and Mandron.
Substitute Hope paved a way back into the contest for them on 65 minutes - Mandron worked some space on the left and he found Hope on the edge of the area, who curled the ball in off the woodwork.
After City skipper Ryan O'Reilly limped off with an injury, his replacement Ed Sanders was soon caught up in the action when he tripped Mandron in the 18-yard box, with the referee awarding the penalty.
Mandron stepped up and made no mistake to draw Sunderland level, and to put them firmly in the ascendancy for the remainder of the match.
The Potters were unfortunate on 79 minutes when Richards found himself at the centre of the action again - this time he found the net but was deemed offside from Peter Makrillos' preceding shot.
A Mandron header forced a stop from Eve moments later, and it looked as though the spoils would have shared until Hope struck in the 92nd minute.
He picked up the ball well outside the area and struck a sweet left-footed ball into the net, leaving Eve with no chance and sending his team-mates into raptures.
Stoke City: Eve; Shields, Coulson, O'Reilly (Sanders 67), Strong; Lecygne; Cook (Makrillos 65), Monlouis; Scott; Nardiello (Ricketts-Hopkinson 87), Richards.
Sunderland: Maddison; Ledger, Gibbons, Sukar, Noble; Gooch, Martin (Hope 45), Agnew (Cartwright 78), E Robson, T Robson (Honeyman 45); Mandron.