Matthew Taylor scored a dramatic last-gasp penalty winner to move Portsmouth a giant step closer to Premiership survival as Harry Redknapp's side came from behind to claim a crucial victory.
Already-relegated Sunderland gave the home side an almighty scare by taking a shock lead through Tommy Miller before two goals in 14 minutes from Svetoslav Todorov and Taylor earned Pompey the win.
Benjani Mwaruwari came agonisingly close to scoring his first goal in English football when his 25-yard shot deflected off Gary Breen and into the arms of a grateful Kelvin Davis.
Dean Kiely came to Pompey's rescue 12 minutes before half-time when the Republic of Ireland international palmed away Miller's 25-yard piledriver.
Benjani should have ended his 17-hour goal drought when he found himself unmarked at Kelvin Davis' back post for an Andres D'Alessandro free-kick but headed straight into the goalkeeper's hands.
Pompey's luckless £4.1million record signing wasted a second golden opportunity in quick succession when he hammered Taylor's low cross against Kelvin Davis' legs from the edge of the six-yard box.
Sunderland caretaker-manager Kevin Ball was forced into a half-time substitution, bringing on defender Nyron Nosworthy for striker Jon Stead, who picked up an injury in the first half.
Todorov joined the Benjani school of finishing by passing up two clear-cut chances in a matter of seconds early in the second half.
First the Bulgarian shot over from six yards from another pin-point D'Alessandro free-kick, and he then fired straight at Kelvin Davis after being played one-on-one with the Sunderland keeper by Gary O'Neil's defence-splitting crossfield pass.
Benjani produced his best attempt of the game 62 minutes in when he dispossessed Breen on the left edge of the penalty area before firing in an angled shot which Kelvin Davis did well to keep out.
Kelvin Davis was the hero again seconds later when he produced a superb double stop, first to keep out namesake Sean Davis from long range and then to smother Todorov's follow-up shot from two yards.
Sunderland took the lead against the run of play 20 minutes from time as Pompey paid the price for committing too many men forward for a corner.
O'Neil's cross was cleared by the Black Cats and Miller beat a flat-footed Brian Priske on the halfway line and set off on a 40-yard run before exchanging passes with Julio Arca and tapping the ball past the helpless Kiely from two yards out.
Pompey's response was immediate with Todorov drawing the south coast side level inside of three minutes.
The Bulgarian striker picked up the ball inside the Sunderland penalty area before shrugging off the challenge of two defenders and firing into the top right hand corner of the net.
Kevin Kyle handed Pompey the chance to take a crucial lead when he needlessly punched away Taylor's 88th-minute corner.
Referee Mike Dean had no hesitation in pointing to the spot and Taylor calmly stepped up to fire the ball past Kelvin Davis and into the bottom left hand corner.