Conor Chaplin came off the bench to get the crucial late goal and give the 900-plus visiting fans the perfect present.
That came after Gareth Evans had headed home to cancel out Ryan Cresswell’s opener before the break.
Paul Cook made one change from the side that convincingly beat Hartlepool the previous week.
Christian Burgess injured his ankle ligaments in that game, so Matt Clarke replaced him at the heart of defence.
It was the side at the summit who made the brighter start and Clarke did well to clear Joel Byrom’s dangerous ball into the box.
But the visitors soon settled and came close to breaking the deadlock on 10 minutes, with Caolan Lavery’s low cross just out of reach for the onrushing Evans.
And Evans had another decent opportunity moments later, only to swipe at thin air after Marc McNulty had done brilliantly to tee him up.
The Blues received a let-off at the other end when Adam Webster’s poor touch sent Marc Richards through on goal, but Brian Murphy came to the defender’s rescue with a vital block.
It was only a brief reprieve, however, as from the resulting corner, Byrom’s cross was firmly headed home at the far post by Cresswell.
That left Pompey shell-shocked for a while, but they soon settled back into their patient passing play.
Lavery headed wide from a Ben Davies cross before McNulty’s low cross had to be cut out by Cresswell.
Then after Adam Smith came racing from his box to beat Lavery to the ball, McNulty was unable to catch the Cobblers keeper out from almost halfway.
But the Blues were level on 32 minutes – and it was the impressive McNulty who created it.
The forward did brilliantly to shake off a couple of challenges and stand up a fine cross that EVANS expertly headed into the top corner.
Northampton came close to extending their advantage soon after when a corner led to an almighty scramble in the box.
Cresswell inadvertently did Pompey’s job for them by clearing a shot off the line and Clarke eventually got the ball to safety.
But it was the visitors who finished the half on the ascendency and Smith did well to parry clear Lavery’s angled drive following good work from Kyle Bennett.
Then, in stoppage-time, Smith was again called into action to stop McNulty from converting Davies’ cross.
Northampton Town 1
Pompey tried to continue where they had left off at the start of the second half and were looking to use the strong gusts to their advantage.
There were a couple of half-chances, although Lavery was offside when he tried to collect Bennett’s through ball
Zander Diamond then recovered quickly after his slip had threatened to send the lively McNulty away.
Bennett had two efforts blocked from the edge of the box in quick succession as the Blues continued to push for another goal.
They had another opening just past the hour mark when, with McNulty in an offside position, Lavery chased down his own pass and was only just beaten to the ball by Smith.
The keeper then made sure he got his body behind Evans’ fierce 30-yard drive following a surging run from the Pompey winger.
Northampton need to make a change to halt the one-way traffic and introduced former Blues midfielder Ricky Holmes.
It was the Blues who came close to forging ahead on 70 minutes, though, when after a poor Davies corner was partially cleared, Danny Hollands’ effort was deflected inches past the post.
Smith was still having to be alert between the sticks for the hosts and he was again quickly off his line to deny McNulty following good work from Michael Doyle and Lavery.
Evans was next to go close, but could only fire wide when Bennett’s cross came in at an awkward height.
It was Bennett who made way when Cook decided to make his first change and introduce Ben Tollitt on 76 minutes.
Despite struggling to make much of an attacking impact in the second half, the hosts then almost retook the lead.
Brendan Moloney’s effort was deflected behind and from the resulting corner, Diamond headed over from just a couple of yards out.
The tireless McNulty was then withdrawn for the final 10 minutes, with Adam McGurk given a chance to impress.
It was Northampton who were now looking dangerous, however, and the imposing Cresswell headed a corner against the crossbar.
Cook’s final throw of the dice saw Chaplin come on for Lavery – and it proved to be a masterstroke.
Fellow substitute Tollitt was the creator, bursting down the right and angling in a shot that was too hot for Smith to handle.
The ball fell kindly for CHAPLIN, who had the simple task of sliding in from a couple of yards out, sending the travelling fans wild with delight.
It was not quite game over, though, and Dominic Calvert-Lewin almost got an immediate equaliser with a header that left the crossbar shaking.
But the Blues saw out the final few minutes to leave themselves on the brink of the automatic promotion places.
Northampton (4-2-3-1): Smith; Moloney, Diamond (Hoskins 89), Cresswell, Buchanan; O’Toole, Byrom; D’Ath, Potter (Holmes 65), Adams (Calvert-Lewin 57); Richards (c)
Goals: Cresswell 17
Booked: O’Toole, D’Ath, Cresswell
Subs not used: Clarke, Lelan, McDonald, Taylor
Pompey (4-2-3-1): Murphy; Davies, Webster, Clarke, Stevens; Hollands, Doyle (c); Evans, McNulty (McGurk 80), Bennett (Tollitt 76); Lavery (Chaplin 85)
Goals: Evans 32, Chaplin 86
Booked: McNulty, McGurk
Subs not used: Bass, Haunstrup, Barton, Close
Referee: Fred Graham
Attendance: 5,859 (938 Pompey fans)