A late George Honeyman winner sealed three massive points for Sunderland in the race for automatic promotion.
The Black Cats had to fight back from conceding an early goal to send their travelling support into delirium.
Charlie Wyke had got them back into the game with his second goal of the season, before substitute Honeyman.
With Barnsley dropping points at Burton Albion, it had the makings of a seismic afternoon in the hunt for second.
Sunderland had suffered a blow before kick off, the influential Aiden McGeady ruled out with injury.
Lewis Morgan took his place as Ross by and large stuck with the template that had produced such an impressive result and performance at Accrington Stanley on Wednesday night.
They started the better of the two sides again, if not quite as explosively.
Dylan McGeouch had the first effort of the game when he arrived at the edge of the area, but his shot was easy for Joshua Lillis to gather in the Rochdale goal.
The hosts had enjoyed a significant bounce in results since Brian Barry-Murphy took charge and despite it being Sunderland who had the better of play, it was easy to see why.
Rochdale looked organised and in Aaron Wibraham and Ian Henderson, they had an experienced pairing whose movement and aerial threat caused problems.
Sunderland did go close when Lynden Gooch crossed for Charlie Wyke, his header blocked before Lillis saved from Will Grigg as he met the loose ball.
Barry-Murphy's side had not shown a great deal in front of goal but took their first real opportunity to get on the scoresheet.
Denver Hume couldn't prevent a cross from the right-hand side, the ball coming back in for Henderson, who took a touch before converting.
Sunderland's rhythm was further disrupted when Gooch went off an injury soon after, George Honeyman taking his place.
The impressive Oliver Rathbone then nearly doubled the scores with a dipping effort from distance that dropped just wide of Jon McLaughlin's far post.
Max Power forced a good save from Lillis shortly before the break when his curling shot headed for the top corner, but the Black Cats went into the break behind and in need of inspiration.
Their tempo was better and it was Charlie Wyke who got them back on level terms.
It had been a good move to build the pressure, Honeyman and Luke O'Nien building the play down the right.
It came over to the other side when Hume drove forward and played the ball into Wyke on the edge of the area, who did superbly to turn his marker and fire into the bottom corner.
The game was now swinging from end-to-end, Sunderland unfortunate that Grigg just couldn't gather a low cross from Honeyman.
Rochdale went close at the other end when Jack Baldwin tried to deal with a long pass through the middle, McLaughlin having to dash back to turn his attempted clearance over the bar.
Still in the relegation mire, the home side had no intention of sitting in for a point and it created a tense, open half.
A spell of Rochdale pressure tested the away side but they were able to survive a flurry of corners to keep their hopes of a win alive heading into the final ten minutes.
They had a promising opening when substitute Kazaiah Sterling got the byline, cutting a low cross to the edge of the area when Dylan McGeouch could only shoot over.
The Black Cats were now making most of the running and got their reward when the irrepressible O'Nien surged to the byline, sending a low cross for Honeyman to convert.
Six minutes were added on but Sunderland held out comfortably for three precious points.
Sunderland XI: McLaughlin; O'Nien, Flanagan, Baldwin, Hume; Gooch (Honeyman, 32), Power, McGeouch, Morgan (Sterling, 78); Wyke, Grigg
Subs: Ruiter, Ozturk, Leadbitter, Dunne
Rochdale XI: Lillis, McLaughlin, Ntlhe, McNulty, Ebanks-Landell, Bunney; Camps, Rathbone, Done (Dooley, 65); Wilbraham (Williams, J, 69), Henderson (Inman, 80)
Subs: Williams (M), Keohane, Hamilton, Wade
Bookings: Hume, 15 Bunney, 50 McGeouch, 53 Williams, 85
Attendance: 6,546 (3,378 away)