Sunderland's terrible start to the season continued as Winston Reid scored the winner in the fourth minute of added time.
West Ham had an early penalty appeal turned down when Javier Manquillo wrestled match-winner Winston Reid to the ground.
Dimitri Payet had a couple of good chances for the Hammers. The Frenchman firstly tested Sunderland 'keeper Jordan Pickford and then hit the woodwork.
Sunderland's best chance came from Wahbi Khazri but the midfielder's weak effort was saved by Adrian.
The Black Cats appeared to be heading for a point but Winston Reid then struck late on with a left-footed effort past Pickford, consigning Moyes' men to Sunderland's seventh defeat in nine games.