Dale looked to be heading for defeat, with Luke Norris putting the Cobblers ahead inside two minutes and Stuart Dallas regaining the lead following Ian Henderson's equaliser.
But Michael Rose levelled again in the 88th minute and George Donnelly popped up with the winner with just seconds remaining.
That was enough to take advantage of Chesterfield's 2-2 home draw with York.
Luke O'Neill and Ryan Jarvis put the Minstermen into an unlikely two-goal lead but Jay O'Shea and Armand Gnanduillet (penalty) ensured a point for the hosts.
Third-placed Exeter fought out a goalless draw at fourth-placed Oxford, who had Dave Kitson sent off for late second caution.
Fleetwood remained in fifth place despite being beaten 1-0 by Scunthorpe, who rose to 12th with three points.
Sam Winnall was the match-winner just before the hour mark.
Morecambe also held their position, sixth, despite a setback.
They were beaten 3-0 at Cheltenham, who had Matt Richards, Terry Gornell and Byron Harrison on the scoresheet, and also had Mark Hughes sent off two minutes into the second period.
Bottom club Accrington claimed their first win of the season with a 2-1 triumph over fellow strugglers Bristol Rovers.
They had to come from behind to do so following Alex Henshall's fifth-minute opener.
James Gray levelled and Kal Naismith won it for Stanley in the 29th minute.
Hartlepool made it four wins in a row as they defeated visiting AFC Wimbledon 3-1.
Simon Walton and Harry Pell exchanged penalties to leave the game tied before Matthew Dolan and Luke James won it for Pools.
Burton were 2-0 winners over Torquay at Pirelli Stadium, going eighth in the process.
Jimmy Phillips and Adam McGurk scored after 70 and 80 minutes respectively.
Dagenham defeated 10-man Southend 1-0, with Rhys Murphy scoring soon after Mark Phillips' 27th-minute dismissal.
Bury against Mansfield and Plymouth versus Newport both ended goalless, while Wycombe's trip to Portsmouth was abandoned after 45 minutes due to a waterlogged pitch.
The sides were tied at 1-1 when the officials made the decision.