The England international struck twice in three second-half minutes to cancel out Carlton Cole's 46th-minute strike and Lukas Podolski made the game safe late on
The England winger's quickfire double got Arsenal's title hopes back on track after a run of three Premier League games without a win and ensured London rivals West Ham drop into the relegation zone.
Arsene Wenger's side had to respond to falling behind to Carlton Cole's 46th-minute tap in following a mistake from Wojciech Szczesny.
|VIEW FROM UPTON PARK
|By Greg Stobart
This was a huge win for Arsenal’s title prospects and Arsene Wenger can now sit back on Thursday knowing that at least one rival will drop points.
His side did it the hard way, but at this time of year it’s all about the results, especially when the Gunners had failed to win in their last four matches in all competitions.
They fell behind to Carlton Cole’s strike early in the second half and there was a period when it looked like Arsenal could disintegrate as the Hammers missed opportunities to double their lead.
But they showed the character of potential champions. Theo Walcott steered in the equaliser with a help from some poor goalkeeping before the England winger produced a thumping header to put the visitors ahead.
Substitute Lukas Podolski made a real impact and rounded off the victory with a typically powerful strike, with the only real downside for Arsenal the injury sustained to Aaron Ramsey.
For West Ham, other results mean they drop in to the relegation zone. They showed some heart but the naivety of some of their defending and the lack of heart once Arsenal came back into the game will worry both the supporters and Sam Allardyce.
Walcott levelled in the 68th minute with a shot that ought to have been kept out by Adrian, before sending a powerful header home after meeting a cross from the returning Lukas Podolski, who was introduced after Aaron Ramsey had hobbled off with a muscle strain.
Podolski himself sealed the win 11 minutes from time, marking his first appearance since August after a lay-off with a hamstring injury in style with a well-taken goal from Olivier Giroud's lay-off.
Kevin Nolan returned from suspension as Sam Allardyce made four changes, while Arsenal midfielder Santi Cazorla came in for Tomas Rosicky.
The hosts started strongly and Mark Noble tested Szczesny with a curling free-kick from the corner of the penalty area in the 10th minute.
Arsenal responded well and tested Adrian for the first time five minutes later, the goalkeeper leaping to his right to keep out Cazorla's powerful header from the edge of the box.
Mohamed Diame sent in a rasping drive from 30 yards which Szczesney gathered at the second attempt in the 25th minute. Walcott ought to have given the visitors the lead a minute later, when he volleyed wide from eight yards after being picked out by Ramsey's chipped pass.
Cazorla fizzed a 20-yard shot a foot over Adrian's crossbar before Giroud scuffed his shot wide 30 seconds later when through on goal.
The visitors continued to press for the opener, Mikel Arteta sending his volley a yard wide from the edge of the box a minute before the break.
But they were stunned when Cole put the hosts in front inside the first minute of the second period, turning home the rebound from seven yards after Szczesny had spilled Nolan's shot from the edge of the box.
West Ham had three clear chances to double the advantage in the next 10 minutes, Szczesny beating away Matt Jarvis' effort before Joey O'Brien and Cole were both guilty of missing the target from close range.
O'Brien headed wide when unmarked eight yards out, before Cole poked an effort of target from similar range.
Arsenal threatened an equaliser on the hour-mark, Adrian denying Cazorla before reacting smartly to keep out Mesut Ozil's follow-up with his legs.
The equaliser did arrive eight minutes later, Walcott cutting inside before scuffing a tame left-footed effort towards goal that Adrian somehow allowed to squirm through his grasp and into the net.
Three minutes later the turnaround was complete when Walcott headed home Podolski's left-wing cross to make it four goals in his last three matches.
Adrian rushed from his line to foil Podolski two minutes later, but the Germany international was not to be denied a goal as he lashed home a first-time effort to seal Arsenal's fifth win six visits to Upton Park.