Werner, who has struggled to make a significant impact since joining for £47m last summer, started and finished the move that settled a tightly-fought game.
The Germany forward fired home from Ben Chilwell’s cross after a well-worked move involving Christian Pulisic, Werner’s sixth Premier League goal since arriving from RB Leipzig.
West Ham struggled to create chances and finished the game with 10 men after Fabian Balbuena was shown a straight red card in the 81st minute after catching Chilwell’s leg with his follow through while making a clearance.
Referee Chris Kavanagh watched a replay on the pitchside monitor before dismissing the Paraguay defender.
The Hammers remain fifth in the table, three points behind Chelsea, after Liverpool’s failure to beat Newcastle earlier on Saturday.
In what was billed as a huge game in the race for the top four, West Ham were hoping to deliver a victory for the underdog at the end of a week when the so-called “big six” tried to break rank and join the European Super League.