The hosts had trailed 2-1 heading in to the closing stages at Spotland, winger Stuart Dallas giving Northampton the lead for the second time after Ian Henderson had cancelled out Luke Norris' opener.
However, Rochdale levelled for the second time when defender Michael Rose's free-kick found the net after 88 minutes, and the turnaround was completed in the 91st minute as striker George Donnelly struck to seal victory.
Rochdale now sit at the summit of the division following Chesterfield's 2-2 draw with York City.
Paul Cook's men went into the game without a win in four league matches, and they were indebted to an Armand Gnanduillet penalty and a Jay O'Shea strike for a share of the spoils after Luke O'Neill and Ryan Jarvis had put York two goals to the good.
Exeter City stay third after they were held to a goalless draw at Oxford United, while striker Sam Winnall's second-half effort gave Scunthorpe United a surprise 1-0 win at Fleetwood Town.
Morecambe's nine-match league unbeaten run was brought to an end as they lost 3-0 at Cheltenham Town, striker Byron Harrison scoring his fourth of the season to help the hosts to victory after captain Mark Hughes had been sent off for Jim Bentley's visitors.
Adam McGurk was on target for the fifth time this term as Burton Albion beat Torquay United 2-0, and Accrington Stanley clinched their first league win of the season with a 2-1 success against Bristol Rovers.
Portsmouth's game with Wycombe Wanderers was abandoned at half-time with the scores level at 1-1 due to a waterlogged pitch at Fratton Park, while Plymouth Argyle drew 0-0 with Newport County in a game interrupted by floodlight failure.
Elsewhere, Hartlepool United stretched their winning streak to five matches in all competitions as they defeated AFC Wimbledon 3-1, Dagenham and Redbridge won 1-0 at Southend United and Bury played out a 0-0 stalemate with Mansfield Town.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.