A late rally saw Aaron Ramsey fortuitously find the back of the net to put Arsenal back in front, though, before Alexandre Lacazette added two of his own to kick off the Arsene Wenger farewell tour with a victory.
Arsenal struggled to turn their possession into chances in the first half and it was West Ham, sticking with Arnautovic as a false nine, who looked the more likely to net in the opening quarter of the match.
Arnautovic tested stand-in Arsenal stopper David Ospina - one of five changes for the hosts today - with the angle against him 15 minutes in.
Cheikhou Kouyate then got his head to a near-post delivery and looped the ball onto the top of the crossbar, offering another warning for the lacklustre home side.
The Gunners' best openings before the interval fell the way of Danny Welbeck, who guided one edge-of-the-box shot inches wide and sent a diving header over the crossbar.
Arsenal's first attempt on target saw Joe Hart comfortably keep out Granit Xhaka's free kick, shortly before Wenger's men were dealt a blow with the injury loss of Mohamed Elneny - the midfielder visibly upset as he left the pitch on a stretcher.
An improved showing at the start of the second half saw Arsenal edge in front as, two minutes after blasting a good chance right down the throat of Hart, Hector Bellerin was again left unmarked and this time volleyed a corner past the English keeper.
That double change proved a shrewd choice by David Moyes, with Hernandez heading over the bar moments after coming on and Arnautovic firing over as momentum began to shift.
Arnautovic fared better from his next chance, rifling the ball across Ospina into the far corner with a fine finish to keep West Ham's run of goals in away matches - now at least one in each of their last 10 - going.
Hart produced a good stop down to his left to tip aside Xhaka's goalbound shot, before doing likewise with Welbeck's curler 10 minutes from time.
A big slice of fortune helped the Gunners to regain the lead, as Ramsey's cross for substitute Pierre-Emerick Aubameyang was left by Declan Rice and caught Hart by surprise, going right the way through.
Lacazette then took over, adding his first through a shot that deflected off Aaron Cresswell past a wrong-footed Hart and a second moments later with a composed finish from a central position inside the box.
Arsenal stay fifth in the table, now 11 points adrift of fourth-placed Tottenham Hotspur, while West Ham remain in relegation trouble ahead of a tough run-in.
ARSENAL (4-2-3-1): Ospina; Bellerin, Mustafi, Koscielny, Monreal; Xhaka, Elneny (Maitland-Niles 45'); Ramsey, Iwobi (Aubameyang 70'), Welbeck (Chambers 88'); Lacazette
WEST HAM UNITED (3-4-2-1): Hart; Ogbonna, Rice, Cresswell; Zabaleta, Kouyate, Noble, Masuaku (Carroll 86'); Fernandes (Lanzini 60'), Mario (Hernandez 60'); Arnautovicbody check tags ::