Chesterfield are effectively relegated after an undeserved defeat at Sixfields.
Simon Cox's 78th-minute strike separated the sides after a quickly-taken free-kick from the bright Bradley Johnson. Cox coolly slotted past Chesterfield keeper Barry Roche for his third goal in four matches.
Chesterfield produced a valiant display and were denied by Cobbler's keeper Mark Bunn on numerous occasions. The Spireites dominated for long spells and did not look like a team third from bottom of the table.
Bunn was called into action on 12 minutes when he produced a fantastic double-save from a Colin Larkin volley, which was followed-up by a Derek Niven header which Bunn plucked out of the air.
As the Cobblers struggled to stamp their authority on the game, the visitors forced Bunn into action again when Jamie Lowry's 20-yard low drive was well saved.
The first meaningful chance for the Cobblers was in the 36th minute, when Chesterfield defender Alex Bailey nearly put through his own net under pressure from the impressive Cox.
The second half began in the same vein, as the Spireites continued to exert their pressure on the Cobblers defence. On 51 minutes, the lively Chesterfield striker Jamie Ward saw his 25-yard strike go just over the bar.
Ward was frustrated again soon after as he saw a low drive tipped around the post by the outstanding Bunn.
This pressure accounted for nothing as Cox hit the winner to confirm that the Cobblers will be playing League One football next season.
Despite Cox's strike, Bunn still had to stay alert as the Spireites drove for an equaliser. Substitute Nicky Rizzo made his presence felt by forcing Bunn into two more excellent saves.
On 80 minutes, Rizzo curled shot was tipped around the post, and the duel continued as Rizzo's 82nd-minute header was pushed onto the post by man-of-the-match Bunn.
Chesterfield's relegation will be confirmed if they fail to beat relegation rivals Bradford City next Saturday at Saltergate.