The Hammers have now moved up the Premiership table from bottom to 15th.
Academy graduate Freddie Sears was the star of the show, scoring a second half goal to kill off the game.
21-year-old Sears was delighted after scoring his first goal in almost three years for the Hammers during which time he has spent numerous months out on loan to different Championship clubs.
"It was a great feeling,” said Sears.
“Just to be back playing in West Ham colours is a better feeling but to get the win and to get the goal was great. There is a great feeling around the place and the dressing room is buzzing.”