Southend United ended their seven-match league run without a win thanks to Junior Stanislas' injury-time clincher.
The winger, on loan from West Ham United, fired a free-kick straight into the Northampton wall, but made no mistake when he was handed a second chance minutes later.
The 19-year-old fired over the wall and saw the ball bounce in front of Cobblers keeper Chris keeper and into the net with 93 minutes on the clock.
Southend had the better chances early on in a fairly even first half. The first came after seven minutes when Northampton goalkeeper Chris Dunn dived at the feet of the onrushing Alex Revell as he bore down on goal.
Seven minutes later Dougie Freedman fired wide of the right post from 14 yards after being teed up by Revell's square ball.
And Peter Clarke headed a Rob Milsom corner from the right wide after meeting the ball at the near post.
Northampton's first chance came in the 32nd minute when Adebayo Akinfenwa set up Kyle Walker, but Blues goalkeeper Steve Mildenhall palmed clear his 25-yard shot.
Walker then lashed a Liam Davis cross from the left well over the bar when he should have done better.
The Shrimpers replied with Simon Francis releasing Osei Sankofa to the right byline, but his cross missed the outstretched Revell and deflected across the face of the goal off Jason Crowe.
The Cobblers had the last say of the half when Akinfenwa toed a shot straight at Mildenhall.
After the break Alan McCormack and Milsom were off target for Southend, while Giles Coke and Leon Constantine did the same at the other end.
Southend created their best chance so far on the hour mark when Mildenhall's kick found Freedman, who passed to Revell who in turn fed Stanislas. The winger beat two men but saw his shot deflect off Dunn for a corner.
Southend fans were screaming for a goal after Dunn caught Revell's looping header from Stanislas' left-wing cross and took a step backwards. But their appeals were in vain.
The Cobblers were reduced to ten men in the 76th minute when Abdul Osman was sent off for a second bookable offence after felling Johnny Herd.
Southend were unable to make their extra man count, until Stanislas fired in the winner three minutes into stoppage time.