Barnsley boss Daniel Stendel praised his side after they maintained their excellent form.
The Reds came from behind to move up to third in the League One table - just two points shy of second-placed Portsmouth.
Rochdale took the lead against the run of play through Ian Henderson.
But Kieffer Moore and Cauley Woodrow hit back as the hosts sealed the much-needed win and kept their unbeaten Oakwell record intact.
Stendel was happy that his side bounced back from the blow of conceding to seal three important points.
"Today was not our best game but it was an important win," said the German.
"The main thing was the three points.
"I think the mentality was good from the players but when you lose a little bit of concentration it doesn't help.
"We turned it around in the game today and I think that was the first game that we have come from behind to win.
"Normally we score the first and win the game.
"So today was an important experience for us."
Stendel was assisted in the dugout by former Barnsley player Dale Tonge, who has stepped up following the departure of previous number two Andreas Winkler to Huddersfield Town.
The first half was effectively a non-event, with few chances created by either side.
The hosts' full-back Dimitri Cavare went on a couple of enterprising runs forward but was let down on both occasions by his poor choice of pass whilst Dale's Ryan Delaney blazed over from just a few yards out just before the break.
Just after the interval the Reds found themselves trailing: Ian Henderson coolly slid home after a quickly-taken free-kick caught the home defence napping.
It is perhaps a sign of the Reds' mental strength these days that instead of wilting, they came out fighting in response to Dale scoring.
And Moore duly restored parity with a thunderous effort from outside the box just five minutes later, for his 16th goal of the campaign.
Henderson drew a fine save from Adam Davies in the 70th minute as Rochdale pushed for a winner but it was to be the hosts who scored the crucial third goal.
Jacob Brown cleverly weaved away from his man in the box and the ball flipped up for Woodrow who gleefully smashed it home for what proved to be the winner.
Barnsley: Davies, Cavare, Pinnock, Lindsay, Williams, Brown, Mowatt, McGeehan, Thiam (Dougall 46), Woodrow (Adeboyejo 90), Moore (Green 78)
Subs not used: Greatorex, Hedges, Jackson, Pinillos
Rochdale: Lillis, McLaughlin (Matheson 76), McNulty, Delaney, Ebanks-Landell, Dooley, Andrew (Inman 82), Camps (Wilbraham 81), Holden, Hamilton, Henderson
Subs not used: Norman, MJ Williams, J Williams, Adshead
Referee: A Young.