The hosts had lost their last four games but there was little to suggest a fifth would be on the cards against their high-flying visitors.
Rochdale created the clearer chances in an open first half. Bobby Grant, who passed a late fitness test on a shoulder injury, fired a fierce drive against the crossbar while Scott Brown was at his best with a double save to deny Ashley Grimes and Andrew Tutte in quick succession.
Grant opened the scoring in the 38th minute, collecting a short pass from Dele Adebola on the left edge of the penalty area before sending a stunning curling effort past Brown.
Grimes made it two-nil with an equally impressive strike from 25 yards in injury time at the end of the first half, his polished finish leaving Brown rooted to the spot.
The visitors were briefly back in the game when Phil Edwards scooped the ball into his own net three minutes into the second half after Josh Lillis had parried Chris Zebroski's effort.
But another fine strike from Grimes in the 67th minute, quickly followed by a tap-in from Adebola, made the result safe for the hosts.