They got off to a poor start and Michael Harriman soon put the League Two side into the lead at a chilly Fratton Park.
But Leon Maloney’s first senior goal levelled the tie before the break and a stunning Marcus Harness strike proved to be the winner.
Kenny Jackett made nine changes from the side that beat Altrincham to progress in the FA Cup at the weekend.
Anton Walkes – who moved to left-back – and Harness were the only players to keep their place in the starting line-up.
Brett Pitman skippered the team up front, with Gareth Evans and Maloney also returning to the forward line.
A fit-again Ross McCrorie featured alongside Andy Cannon in midfield, with James Bolton, Paul Downing and Sean Raggett in defence, and Alex Bass between the sticks.
The hosts looked rusty in the opening stages and Bass was forced to deny Matt Warburton in the opening seconds.
But Northampton did go ahead on 12 minutes, with Harriman left unmarked to convert Joe Martin’s cross from a few yards out.
Pompey did grow into the contest, though, and Evans drew a smart stop from Steve Arnold after collecting Harness’ pass and cutting onto his left foot.
Jordan Turnbull then did well to divert McCrorie’s drive behind following a threatening run from the Scotland under-21 skipper.
And when the same player was brought down on the edge of the box, Harness’ free-kick was just too high for Downing at the back post.
The equaliser did arrive on 39 minutes and it was a moment to remember for MALONEY, who bravely stooped to head home another Harness delivery and open his Pompey account.
A coming together between Martin and Bolton led to pushing and shoving by the South Stand touchline late in the first half.
Referee Will Finnie eventually managed to calm the pair down and showed both players a yellow card.
Northampton Town 1
There was an early chance for the Blues once the action restarted, with Pitman’s header clawed away by Arnold.
Warburton then tried his luck from long-range at the other end, but the ball flew straight into the arms of Bass.
The keeper made a much better save soon after, getting down to keep out Billy Waters’ firm strike after the substitute had been sent through on goal.
Both sides looked capable of taking the lead and Pitman went close with a couple of headers just a minute apart.
He probably should have done better with the first, sending the ball wide from close-range, but the second was a clever effort from further out that looped narrowly over.
Pompey were suddenly looking a real threat and it came as no surprise when they went ahead just past the hour mark.
It was a stunning volleyed finish from HARNESS that thundered into the net after an Evans cross was cleared into his path.
Jackett immediately made a double change, with Maloney and McCrorie making way for John Marquis and Brandon Haunstrup.
And the Blues almost increased their advantage moments later, with Arnold getting down to brilliantly save Pitman’s downwards header.
The skipper certainly deserved a goal for his all-round play and soon bent another shot around the post after being teed-up by the influential Harness.
The action started to wind down as the finish line neared, although a lashed effort from Bolton took a deflection and flew just past the post.
Arnold then kept his side in the contest with a superb save to deny Marquis from point-blank range after Haunstrup had slipped the ball across the box.
Injuries and substitutions meant there were six minutes of stoppage-time to negoatiate, but the Blues saw the game out with ease to secure their place in Thursday evening’s third round draw.
Pompey (4-2-3-1): Bass; Bolton, Downing, Raggett, Walkes; Cannon (Close 86), McCrorie (Haunstrup 63); Harness, Evans, Maloney (Marquis 63); Pitman (c)
Goals: Maloney 39, Harness 62
Subs not used: MacGillivray, Burgess, Williams, Harrison
Northampton (3-5-1-1): Arnold; Hall-Johnson, Wharton, Turnbull; Harriman, McWilliams (Waters 51), Watson (c), Pollock, Martin (Williams 68); Warburton; Smith (Harding 68)
Goals: Harriman 12
Booked: Martin, Harriman
Subs not used: Cornell, Hughes, Ballinger, Kaja
Referee: Will Finnie
Attendance: 2,413 (96 away fans)