Rochdale leapfrogged opponents Accrington as they ended a five-game winless run in Sky Bet League One with a 2-1 home victory against John Coleman's men.
The visitors dominated for long stretches of the first half, with Dale goalkeeper Robert Sanchez keeping out Jordan Clark's half-volley.
Offrande Zanzala was twice denied by defensive blocks from Paul McShane, while Eoghan O'Connell and Sam Finley fizzed a rising drive narrowly wide of the upright.
However, the home side were ahead in the 40th minute. Stanley stopper Dimitar Evtimov could only parry Ollie Rathbone's shot and Ian Henderson rifled the loose ball into the roof of the net from six yards.
Henderson had his second just four minutes into the second half, seizing on a mistake among the Stanley back line as he raced into the area before successfully lifting the ball over Evtimov into the net.
Stanley reduced the arrears with a stunning strike from Joe Pritchard on 53 minutes, his dipping, swerving effort from 30 yards flying over Sanchez and into the top corner of his goal.