The goal stemmed from a Sunderland corner. Robert Green, the goalkeeper, got it from the flag-kick, delivered a ball to the left flank and shortly afterwards Luis Boa Morte squared it for Stanislas to score, leaving the Wearsiders shell-shocked.
Having not scored in their three previous away league games, and not won in six, it gave Sunderland a mountain to climb.
Things got worse for the Black Cats eight minutes after the break when James Tomkins got in front of his marker Anton Ferdinand to head past Craig Gordon.
Sunderland, who are now fourth from bottom in the Premier League, looked unlikely to come back after going 2-0 down.
With Kenwyne Jones and Carlos Edwards jet-lagged after returning from the USA on Friday, boss Ricky Sbragia made four changes to the side that lost at Manchester City two weeks earlier.
Djibril Cisse started as a lone striker with Grant Leadbitter and Kieran Richardson, back from suspension, supporting the Frenchman at every opportunity.
The system worked well in the opening 40 minutes, with Leadbitter, twice, and Cisse going close in the opening stages.
Cisse's powerful shot forced Robert Green to make a fine diving save in the 41st minute and it proved to be a pivotal point.
The Hammers broke from the resulting corner and went ahead. Sunderland looked dispirited after the break.
Tomkins could have grabbed a second goal in the 62nd minute, but this time Gordon, playing his first Premier League game since November, made a decent stop.
Gordon also saved well from Matthew Upson in the second half.
With Stoke and Blackburn winning, Sunderland were left hovering just one place above the drop zone - with a game against Manchester United at the Stadium of Light to follow!
View a Printer Friendly version of this Story.