First-half goals from Clive Platt and Paul Reid made it back-to-back wins for Colchester as they ended Northampton's hope of making three wins on the bounce.
Boosted by their midweek success over Yeovil, which ended a run of three straight defeats, Colchester made the brighter start at Sixfields.
Northampton, who enjoyed an excellent win over Leeds midweek, failed to rediscover their form and were on the back foot for much of the opening period.
Chris Coyne should have given Colchester an early lead when he headed over from Johnnie Jackson's inswinging corner.
But Colchester's aerial presence paid off in the 23rd minute when Dean Hammond crossed and the unmarked Platt headed past Frank Fielding.
Three minutes later former Cobbler Reid outjumped the Northampton defence to head home another Jackson corner to double the visitors' advantage.
Earlier Ryan Gilligan should have given Northampton the lead after being put clear by Scott McGleish, but he opted to pass rather than shoot and the chance was lost.
Gilligan and McGleish both went close just before the break as Town looked to get back into the contest.
The half-time introduction of Nicholas Bignall injected some venom into the Northampton attack and they reduced the arrears in the 53rd minute when Danny Jackman's deflected free-kick wrong-footed keeper Jimmy Walker.
Jackson almost restored Colchester's two-goal cushion immediately as he latched on to Gilligan's misplaced header, lobbed Fielding, but saw the ball bounce wide of the goal.
From then on it was all Northampton as they sought the equaliser.
Bignall cut in from the right and flashed a shot wide, substitute Andy Holt headed over and Leon Constantine cut into the box but shot over the bar.
Colchester continued to look dangerous on the counter-attack and Jermaine Easter should have put the game beyond Northampton when he beat the offside trap, but shot across the face of goal.
It was Northampton who continued to press, with Bignall having a close-range shot blocked and Liam Davis heading inches wide in stoppage time.