Peter Crouch netted a controversial injury-time penalty as Saints dumped their local rivals out of the FA Cup.
With the help of his assistant, referee Steve Bennett ruled Matt Taylor had handled a cross, giving Crouch the opportunity to take the hosts through.
Matt Oakley's super long-range strike had put Saints ahead, but Yakubu's penalty brought Pompey level after Claus Lundekvam fouled Diomansy Kamara.
Kamara was then sent off before Ricardo Fuller wasted a good chance to win it.
It was a tense, tight opening but Pompey had the first sight of goal when Linvoy Primus got forward to slide in a pass for Kamara, but he was denied by Lundekvam's perfectly-timed challenge.
Portsmouth made the stronger start and Patrik Berger drifted inside on nine minutes to slip a dangerous pass to Kamara, but he was closed down quickly by Prutton.
After being on the back foot, Southampton could have taken the lead on 18 minutes when Anders Svensson moved on to Crouch's knockdown, but after side-stepping Arjan De Zeeuw, he was cut off by Dejan Stefanovic.
From the resulting corner, Pompey had a let-off when keeper Kosta Chalkias completely lost the flight of the ball and was relieved when Calum Davenport's header drifted over the bar.
Chalkias had been largely untested on his debut but when Matt Oakley drifted in a free-kick, the giant Greek's punch was again unconvincing.
Crouch, ploughing a lone furrow up front, charged down a clearance and showed neat skills to pick his way to the by-line but Paul Telfer almost caught Chalkias by surprise with a long-range effort the Greek keeper grabbed at the second attempt.
After the break, Gary O'Neil wasted a good opportunity when Davenport's header landed invitingly to him 20 yards out, but he could only blast over.
And it proved a costly miss as Southampton swept to the other end to take the lead.
Matt Oakley put Saints ahead with a fine finish
Svensson laid the ball perfectly into the path of Oakley who blasted home from 20 yards.
Pompey's reply however was instant. Kamara burst into the box and went down under Lundekvam's challenge, giving Yakubu the chance to send Niemi the wrong way from the penalty spot.
With two goals in three minutes, the game had truly burst into life.
Chalkias was again in no-man's land after he failed to gather a corner and although Higginbotham showed great agility to volley the ball home, his joy was cut short by an offside flag.
At the other end, Yakubu was given half a yard of space to get in a shot but Niemi showed great reactions to palm the ball around the foot of the post.
Pompey then suffered a blow on 72 minutes when Kamara - who had earlier been booked - picked up a second yellow for a needless handball and was sent off.
Substitute Fuller missed a golden chance to put Pompey through when he blasted over from seven yards with just a minute left.
And in injury time, Saints made him and Pompey pay.
Referee Bennett pointed to the spot after assistant Mike Tingey indicated Matt Taylor handled a cross.
And after a long delay, Crouch confidently stepped up to slot home the spot-kick, and take Saints into round five.
Southampton boss Harry Redknapp:
"They were both harsh penalties. Diomansy Kamara went down easily and the ball was running out of play.
"As for our winner, I've seen them not given. If he, Matt Taylor, leant towards the ball, then it's a penalty.
"They were both dodgy penalties to say the least."
Portsmouth coach Joe Jordan:
"Everyone wants to get to the FA Cup final and to beat their local rivals.
"The referee has to be 110% sure when you're making major decisions. What a responsibility to make a massive decision like that after changing your mind.
"All of us are bitter and angry about it right now."
Southampton: Niemi, Telfer, Lundekvam, Davenport, Higginbotham, Nilsson (Jones 64), Prutton, Oakley (Jakobsson 73), Delap, Anders Svensson, Crouch. Subs Not Used: Smith, Cranie, Ormerod.
Booked: Prutton, Telfer, Jones.
Goals: Oakley 54, Crouch 90 pen.
Portsmouth: Chalkias, Primus, De Zeeuw, Stefanovic, Kamara, O'Neil, Hughes, Berger, Taylor, Yakubu (Fuller 83), Cisse. Subs Not Used: Skopelitis, Hislop, Mezague, Curtis.
Sent Off: Kamara (72).
Booked: Kamara, Hughes, De Zeeuw, Stefanovic, Cisse.
Goals: Yakubu 57 pen.
Ref: S Bennett (Kent).