Matt Jarvis silenced the Emirates Stadium by heading the visitors in front, but goals from Olivier Giroud and Lukas Podolski eased the pressure on Arsene Wenger.
Matt Jarvis silenced the home crowd five minutes before halftime with a brave header from close range, but Podolski brought the Gunners level a minute before the break with a powerful low strike.
Giroud put Arsenal into the lead in the 55th minute when he expertly brought down a Thomas Vermaelen pass and fired through the legs of Adrian, and with 12 minutes left Podolski lashed high into the net to seal a vital win.
The result sees Arsene Wenger's men climb above Everton in the table by a point, though Roberto Martinez's side has a game in hand.
The visitors, who remain seven points clear of the relegation zone, began the game with an urgency and pace as they pegged their hosts back in the opening 20 minutes.
Mohamed Diame had two chances to opening the scoring but saw his first effort blocked, and he skied a second over the crossbar from Andy Carroll's neat cutback.
Arsenal finally burst into life 30 minutes in as Cazorla threaded a pass through to Giroud in the penalty area, but the France international's half-hearted flick was easily saved by Adrian.
He was made to rue that finish as West Ham took the lead five minutes before the break. Antonio Nocerino raced away from Kim Kallstrom, making his first Arsenal start, with Jarvis following in with a brave header after Wojciech Szczesny saved the Italian's shot.
West Ham's goal was the catalyst to set Arsenal into life, and the Gunners were on level terms just four minutes later as Cazorla latched onto a poor clearance from Stewart Downing and found Podolski, who slotted home.
Ten minutes into the second half, Giroud made up for his earlier miss to move Arsenal in front for the first time in the game. Thomas Vermaelen delivered a lofted pass into the penalty area that the 27-year-old controlled superbly before firing first-time under Adrian.
Podolski and Cazorla both went close to extending the hosts' lead just after the hour, but Adrian saved well from the German and Cazorla's 20-yard strike was just wide of goal.
The points were sealed in the 78th minute as Podolski doubled his tally, the forward lashing his sixth league goal of the season high into the roof of the net after substitute Aaron Ramsey's headed pass.