In a feisty derby at Fratton Park, Gary Roberts gave the home side the lead on the stroke of half-time before Joshua King nodded in a second-half leveller.
But Pugh, who came on just after the hour mark, tapped in with eight minutes to go to ensure the comeback and a place in the fifth-round.
It was the second consecutive Emirates FA Cup tie that the Cherries notched the winner in the final ten minutes as Eddie Howe's men reached the fifth round for the first time since 1989.
Eddie Howe made ten changes to the side which took a point at Sunderland, with Tommy Elphick returning to the starting line-up after his long-term injury and Juan Iturbe making his first start for the club.
The game started at a frantic pace with the home side in the ascendency, but the Cherries grew into the game and almost had the lead just before the half-hour mark when Iturbe, who had been fairly quiet until that point, exploded into life and hit a sweet effort from the edge of the box which home ‘keeper Ryan Fulton had to tip onto the right-hand upright.
But it was the League Two side who took the lead just before half-time, when 1-0 down McNulty found some space on the left-hand side and got into the area, before squaring the ball to Roberts who slammed in from close range.
After the interval the Cherries remained on the back-foot and Howe looked to liven the game up by bringing on Pugh and Matt Ritchie for Glenn Murray and Iturbe.
The double substitution immediately gave the Cherries a spring in their step and they had the equaliser eight minutes after the substitutions.
Pugh was hacked down by Ben Davies on the left and Eunan O’Kane whipped in the resulting free-kick, with King rising highest to flick the ball on and find the bottom corner.
With ten minutes to go, the Cherries created a flurry of chances, as Grabban forced Fulton into a good stop before Pugh hit an effort in the area which the Pompey keeper also tipped over.
But he was beaten with eight minutes to play as Grabban hit a venomous effort in the area which McGurk had to parry and Pugh reacted quickest and met the rebound at the back-post to knock it over the line and give the Cherries the victory.
Cherries: Federici, Smith, Elphick (Francis 77), Distin, Cargill, King, O'Kane, MacDonald, Iturbe (Pugh 62), Grabban, Murray (Ritchie 62).
Unused subs: Allsop, Simpson, Wakefield, Butcher.
Portsmouth: Fulton, Davies, Stevens, Burgess (Webster 62), McGurk (Tollit 77), Doyle, McNulty, Roberts (Evans 62), Clarke, Bennett, Close.
Unused subs: Jones, Naismith, Barton, Chaplin.
Attendance: 18,901 (2885 away fans)
Referee: Mike Dean
Yellow cards: Burgess, O'Kane
Goals: Roberts (43), King (70), Pugh (82).