Elmohamady failed to score a late goal against Hammers
Jordan Henderson scored the winner in the 34th to maintain his side's unbeaten home record in the league.
The 23-year old player had a late effort on goal but his shot missed the target.
It was the fifth straight appearance of Elmohamady as a substitute for the Black Cats as he lost his place in the starting line-up.
Sunderland are now seventh in the Premier League table with 23 points, while the Hammers are down at the bottom with just 12 points.
Short link: