The Cobblers’ hopes of reaching the Sky Bet League Two play-offs suffered a setback as they were beaten 2-1 by 10-man Bury at Gigg Lane.
Town opened the scoring through Ricky Holmes in north Manchester but, despite having an extra player for 40 minutes of the game, were undone by goals from Kelvin Etuhu and Adam El Abd, who scored in the 90th minute.
The decisive goal, a scrambled effort from close range, saw all of the Bury coaching staff run onto the pitch and the home crowd loudly celebrated the final whistle.
So they should - this was an important win for their side and it may turn out to be a fairly meaningful result for Northampton too, who are now five points off the top seven.
There was a reshuffle in attack for Chris Wilder’s side, whose forward line was in need of refreshment after a stale couple of games, with Holmes restored to the starting line-up after a knee injury scare and Sheffield United forward Diego De Girolamo installed as the number 10 behind the recalled Ivan Toney.
It was the Italian who created the opening goal of the game, collecting a pass 30 yards from goal and slipping the ball to Holmes, whose clever run beat the Bury offside trap.
From there, he still had some work to do but steadied himself before firing a right-footed shot past Nick Pope and into the corner of the goal.
The home side saw a lot of the ball after that and were very neat and tidy with it but did little to hurt Town until Tom Soares found space for a shot 12 yards out which Ryan Cresswell blocked at close quarters.
Bury made two substitutions at half-time in a bid to get some energy into what had until that point been a lethargic display.
But they did not require the type of intensity displayed by Riley, who flew into a challenge on Tom Newey for which referee David Coote had no hesitation in dismissing him.
Despite having a man advantage, Northampton did not really bid to capitalise on it and were instead content to attempt to sit on their 1-0 lead.
It was to prove a costly strategy when Danny Mayor punctured the visiting defence and passed to Craig Jones, who won a corner which was cleared but only as far as Etuhu.
The midfielder swung a right boot at it and, with a minor deflection, it crept inside Matt Duke’s right-hand post.
De Girolamo forced Pope into a strong save high to his right with a curled shot from distance as the Cobblers sought to retake the lead and Nathan Cameron should have given it to Bury when he arrived unmarked at the back post at a free-kick but failed to connect with the ball.
Lawson D’Ath, too, should have done better with a rushed shot on the edge of the box after John-Joe O’Toole had done well to recover possession.
With five minutes left to play, D’Ath skidded his shot well wide of the target when he had more time than he realised.
James Gray did likewise after a good piece of build-up play down the left as the bold approach produced goalscoring opportunities.
Trouble was, they did it too late, and Bury seized their opportunity to win the game in the first minute of time added on.
A corner was flicked on at the near post by Ryan Lowe and scrambled over the line by El Abd to secure a win for the side with 10 men.
Northampton, meanwhile, were left to rue a lack of boldness when they had a man extra and the lead in the game. And that reluctance and uncertainty could prove costly in terms of the bigger picture.
Bury: Pope; Riley, Cameron, El Abd, Hussey; Adams, Etuhu, Tutte, Mayor; Soares, Eaves
Subs: Jones (for Adams 46), Lowe (for Tutte 46), Hope (for Eaves 59)
Not used: McNulty, Sedgwick, O’Brien, Lainton
Cobblers: Duke; Moloney, Cresswell, Collins, Newey; Taylor, Byrom; D’Ath, De Girolamo, Holmes; Toney
Subs: Gray (for Toney 54), Hackett (for Holmes 68), O’Toole (for De Girolamo 81)
Not used: Carter, Bodin, Diamond, Jalal
Away fans: 390
Referee: David Coote