Benni McCarthy stepped off the bench to steer Blackburn into the fifth round of the FA Cup.
The South African striker struck deep into extra-time to break Sunderland’s spirit and set up a home meeting with Coventry a week on Saturday.
McCarthy headed home with three minutes remaining following a free-kick from Carlos Villanueva.
Villanueva should have scored himself just beforehand but sent his effort wide of the target from close range.
It was a dramatic end to a game that seemed to be heading for a penalty shoot-out.
David Healy had opened the scoring for Sunderland in the seventh minute only for Aaron Mokoena to pull Blackburn level 30 minutes later.
The home side almost took the lead as early as the third minute when Zurab Khizanishvili’s effort came back off the inside of the post following a corner from Villanueva.
Sunderland again found themselves on the back foot a minute later and Scotland goalkeeper Craig Gordon - back in the side after an ankle injury - did well to push away a shot from David Dunn.
The visitors, however, took the lead in their first attack in the seventh minute through Healy.
The Northern Ireland striker, making only his third start, was the first to react when Daryl Murphy’s shot spun off Ryan Nelsen.
It was a cool finish by Healy and his second goal for Sunderland, his only other strike coming against Nottingham Forest in the Carling Cup in August.
That goal gave the visitors a boost and Steed Malbranque rattled a shot narrowly over the bar in the 16th minute following some sloppy defensive play.
Blackburn hit back and Gordon reacted quickly to push out Keith Treacy’s effort two minutes later.
Gordon was showing no rustiness after his 10-week absence and reacted well to deny Jason Roberts in the 25th minute.
Blackburn should have equalised nine minutes later but Roque Santa Cruz squandered a glorious chance.
The Paraguay striker, who looked on his way to Manchester City in the transfer window, screwed a header wide from four yards following Villanueva’s corner.
It was a clear chance but Blackburn regrouped and drew level in the 37th minute.
Mokoena sent a 25-yard thunderbolt into the corner, leaving Gordon stranded, after Villanueva’s effort had been blocked.
It was the South African’s first goal in almost two years and a timely one at that.
Mokoena’s last goal came in the FA Cup as well - against Manchester City in March 2007.
Blackburn almost went ahead two minutes into the second half when Santa Cruz peeled away from his marker after Villanueva had delivered the free-kick.
The striker’s header was clean enough but Gordon was equal to it and pushed the ball over the bar.
There was little to choose between the sides and Grant Leadbitter went close in the 58th minute following a surging run down the left from George McCartney.
Play switched down the other end and Roberts turned quickly in the penalty area, only for Gordon to block his effort.
Gordon then kept his side on level terms in the 73rd minute when he pushed over a superb free-kick from Villanueva that seemed goal-bound.
Then Khizanishvili sent a free header over the bar nine minutes later following Villanueva’s corner.
Sunderland hit back and Reid failed to take advantage in the 85th minute when Carlos Edwards played the ball to him at the back post but he got a poor first touch and the match went into extra-time, paving the way for the dramatic finish.