Accrington climbed up to 12th with an impressive victory at Victoria Road.
They were always in control of the game once Leighton McGivern headed home Peter Cavanagh's pinpoint cross.
It was 1-1 when Cavanagh turned Danny Foster's shot past his own goalkeeper but Andrew Proctor headed home seconds later to restore Accrington's lead.
The home side had plenty of possession after the break but Paul Mullin nodded home after Roscoe D'Sane's effort came back off the bar to seal their fate.