The home side won their first match of 2015, with Sakho’s 88th-minute winner coming just as it seemed Sunderland would hold out for a well-deserved point.
That defeat keeps Advocaat’s side just one point above the relegation zone, while West Ham move up to ninth in the table.
It was the visitors who made the better start of the two teams, with Connor Wickham linking up well with strike partner Jermain Defoe, before testing Adrian at his near post with a well-struck volley just eight minutes in.
And it was Defoe – signed by previous boss Gustavo Poyet in January to score the goals to keep the club in the top flight – who was guilty of missing the best opening of the first half after being played clean through on goal by Steven Fletcher’s flick on the quarter-hour mark, only for the diminutive striker to blaze horribly off target.
West Ham, meanwhile, played like a side who had failed to win any of their previous seven matches, a poor run that included losing their last two at Upton Park, in the opening period, with the nearest they came to scoring coming when Alex Song’s 25-yard volley forced Costel Pantilimon into a smart near-post stop.
Other than that, however, the Hammers huffed and puffed, but barely looked like blowing the visitors’ house down, despite them producing 25 crosses before the break.
After the interval it was much the same as Sunderland’s rear-guard, led impressively by captain John O’Shea, repelled all that West Ham could throw at them, while at the same time trying to catch their opponents on the break using the pace of Defoe.
But all Advocaat and Co had to show for their attacking endeavours was left-back Patrick van Aanholt’s speculative effort from distance that Adrian turned behind for a corner with 13 minutes to go.
And even the introduction of the returning Adam Johnson after 73 minutes, greeted by a predictable chorus of boos from the home fans, could not increase the Black Cats’ threat up front.
As the minutes ticked by, however, so West Ham’s pressure began to build as Sakho glanced a header inches past the post, before two strong penalty appeals were turned down by referee Lee Mason.
The Hammers were not to be denied a morale-boosting victory, though, and with just two minutes left a neat move on the edge of the Sunderland box involving substitute Nene and Mark Noble saw the latter’s lovely flick play Sakko through, with the Senegalese making no mistake by firing low past a helpless Pantilimon for his 10th league goal of the campaign.
West Ham United: Adrian (6), Jenkinson (6), Kouyate (6), Collins (6), Cresswell (7), Song (6), Noble (7), Jarvis (5), Nolan (6), Downing (6), Sakho (7)
Subs: Nene (6), O’Brien (6), Cole (6)
Sunderland: Pantilimon (7), Reveillere (6), O’Shea (7), Brown (6), van Aanholt (7), Larsson (6), Rodwell (6), Jordi Gomez (5), Fletcher (6), Defoe (7), Wickham (8
Subs: Johnson (6), Graham (6), Vergini (6)
Man of the match: Connor Wickham