Arnautovic - playing in a new role as a lone striker - put West Ham 2-1 ahead by scoring inside the first 30 seconds of the second half. Then the Austrian set up goals for Lanzini in the 56th and 61st minutes.
Mark Noble's opener for the London side in the 25th was cancelled out before the interval by Huddersfield midfielder Joe Lolley. Lolley was at fault for Noble's goal, giving away possession on the edge of his area.
Huddersfield started the day two points and four places above West Ham in the standings, but the visitors have now lost only one of their last eight league games under David Moyes, who registered his 200th top-flight win as a manager.
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.