Two Rochdale goals in the final stages of the game saw Rochdale eliminate the Cobblers from the FA Cup in dramatic fashion.
Town had led for 80 minutes through Ivan Toney’s sixth goal of the season when Reuben Noble-Lazarus steered in a shot to level the tie.
Then, with extra-time looming and four of five added minutes played, centre-back Oliver Lancashire dived to head home a left-wing cross and put Dale into the second round.
It was a cruel way for the game to end and harsh on the visitors, who had been a force in the game and were just five minutes away from a second-round tie but instead found themselves out of the competition.
Just five minutes had been played when Northampton took the lead. Emile Sinclair was clumsily fouled on the corner of the box and the ball in from Darren Carter was exquisite.
Rochdale invited the chance with a defensive line that was so deep the players were almost stood on goalkeeper Conrad Logan’s toes and Toney timed his run to perfection to head home.
They got themselves into an excellent position minutes later with some good passing but Sinclair’s finish was not a smooth one and his shot was well wide of the mark.
Sinclair spearheaded a counter-attack down the left wing and did superbly to find space for a pass which Toney stepped over and Marc Richards rattled goalwards, Logan doing well to get two hands on the ball and make a blocking save.
Jordan Archer had his first meaningful action of the game on the half-hour mark, parrying a stinging Michael Rose free-kick and then doing well to block at the feet of Rhys Bennett, although he was in an offside position when he met the rebound five yards out.
Archer made a good save to deny Matthew Done after Ryan Cresswell had hesitated when dealing with a ball in behind as Rochdale made a brisk start to the second half in search of a route back into the contest.
Substitute Reuben Noble-Lazarus found space for a back-post chance which hit the bar as the home side began to mount some pressure, Kelvin Langmead mopping up the rebound from his own goal line.
Noble-Lazarus must have thought he had spurned his chance to equalise when he completely failed to connect with a bouncing ball from 15 yards but reacted well to strike it again, this time past Archer’s right hand and into the roof of the net.
And in the fourth minute of time added on, Lancashire speared a diving header past Archer to settle the contest.
Rochdale: Logan; Rafferty, Eastham, Lancashire, Rose; Lund, Dawson, Hery; Bennett, Muldoon, Done
Subs: Noble-Lazarus (for Hery 54), Allen (for Rafferty 68), Andrew (for Muldoon 68)
Not used: Lillis, Tanser, Cannon, Hasler-Cregg
Cobblers: Archer; Tozer, Cresswell, Collins, Robertson; Murdoch, Carter, O’Toole; Sinclair, Richards, Toney
Subs: Langmead (for Langmead 68), Byrom (for Sinclair 71), Hackett (for O’Toole 78)
Not used: Duke, Alfei, Nicholls, Mohamed
Cobblers fans: 107