David Moyes' side had taken the lead when, after Kevin Campbell and James McFadden had seen early strikes blocked, captain Alan Stubbs rose to head Thomas Gravesen's corner in at the back post.
Yakubu levelled two minutes later with a powerful drive into the top corner while Patrick Berger forced home keeper Richard Wright into a string of saves.
But it was the late introduction of substitute Marcus Bent that turned the game. He got a fine reception form the Goodison faithful and his added pace and purpose livened up a previously lack-lustre Everton attack.
With just seven minutes left Gravesen forced Shaka Hislop into his first notable save of the second half. He went past three Pompey players before firing a powerful right-footer which had the goalkeeper at full stretch.
As is the trend in the Premiership at the moment referee Walton turned a blind eye to a seemingly warranted shout for a penalty by the Merseysiders.
Matty Taylor was lucky to get away with controlling Tony Hibbert's cross with his arm after it bounced up off his knee.
Everton huffed and puffed but they could not blow a resilient Portsmouth down. The visitors defended valiantly in a frenetic final period but with just seconds left a lofted ball into the box fell to Osman and the youngster's swivelled volley flew high into the top corner to jubilant celebrations.
It was harsh on Pompey but fair reward for Everton's extra endeavour and never say die attitude.
The win was a vital one for the Blues and re-established a safe distance between them and the chasing Champions League pack.
But despite Osman's last-minute heroics David Moyes will recognise just how important James Beattie's arrival could be in his side's quest to cling onto that coveted fourth spot.