Defoe celebrates his last-gasp strike in front of the Portsmouth supporters
Jermain Defoe crashed in an injury-time penalty to secure a first victory for new Portsmouth manager Tony Adams.
Djibril Cisse gave Sunderland the lead after just three minutes after being set free by Andy Reid, but the striker then wasted a succession of chances.
David James denied him three times, while Kieron Richardson hit the post.
Nadir Belhadj then struck from 35 yards after the break to level and, after El-Hadji Diouf fouled Glen Johnson, Defoe earned a real smash-and-grab win.
It was Sunderland's third straight defeat in the league and leaves boss Roy Keane's side just a point off the drop zone.
We didn't deserve defeat - Keane
But it could - and should - have been a different story for Sunderland who had enough chances to win the game comfortably against a Portsmouth side that had lost their previous two games since Adams took over from Harry Redknapp.
After their 5-0 mauling to Chelsea last time out, Sunderland had the perfect start when Cisse threaded the ball through James's legs following Reid's searching 60-yard pass over the top of the defence.
Despite Defoe's typically lively display up front, the home defence were rarely troubled for much of the game and Richardson came agonisingly close to a second for the hosts when his 30-yard drive crashed against the post with keeper James stranded.
James was then twice called into action by Cisse, first palming the striker's header over and then scrambling the Frenchman's drive wide after he had once again escaped Sol Campbell's attention.
The first half might have been all Sunderland, but Portsmouth were quick to redress the balance after the break, Belhadj collecting Niko Kranjcar's pass and crashing a low shot into the corner from 35-yards.
Suddenly, the belief that appeared to have almost completely drained out of Portsmouth since Redknapp's departure for Tottenham a fortnight ago if not flooded back, started to rear its head.
Defoe was all about the home defence and Johnson was enjoying increasing success down the right-hand side with Danny Collins over-exposed.
Cisse continued to threaten up the other end, an offside flag denying him a second when he headed home Reid's cross from an offside position and then a Johnson lunge deflecting his goalbound shot wide late in the game..
Adams relieved Pompey responded
But the match looked to be petering out into a draw until Diouf clumsily brought down Johnson just inside the box, Defoe making no mistake in dispatching the penalty.
And so in a week that saw Adams lose coach Joe Jordan from his backroom staff and fail to entice Martin Keown to join his Fratton Park revolution, it appears things could finally be looking up for the Pompey boss.
Sunderland manager Roy Keane:
"It's very disappointing. We clearly didn't deserve to lose and had enough chances to win the game easily, so to throw it away like we did is very disappointing.
"I've no complaints over the penalty - it was a typical, unnecessary, striker's challenge - but we've paid the price for not taking our chances when they came around.
"I guess I can't fault my players too much today but we'll lick our wounds and make sure we're ready to fight another day."
Portsmouth boss Tony Adams:
"That was probably our worst performance in the four games we've played since I took over and yet we've won - I haven't got a clue how this game works!
"In the first half we were poor, giving the ball away far too easily, and I just talked at half time about technical stuff, being compact, keeping the ball better and looking after Cisse, who I thought looked very dangerous today.
"In the end a win is brilliant and I'm pleased because the players did as they were told."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.