Arsenal are back on track. There was a period early in the second half, after Carlton Cole had put West Ham United in front and the home team suddenly tore into their opponents, when it was possible to fear the worst for Arsène Wenger and his players. The demons of those dropped points against Everton, Manchester City and then Chelsea, not to mention the Champions League defeat at Napoli, had begun to circle in London's East End.

It would not have been difficult to imagine the reaction to another bad result, particularly as there would have been no mitigation with regard to the calibre of the opposition. West Ham United have now dropped into the relegation places and are labouring sorely. But Arsenal are not only a more talented group this season, they are a more resilient one and they showed their mental toughness as much as anything else to gain a reward from what was an entertaining derby.

The bad news was that they lost Aaron Ramsey to a thigh strain on 63 minutes. The midfielder knew immediately what he had done and Wenger reported that he would certainly not play at Newcastle United on Sunday or against Cardiff City at home on New Year's Day. The full extent of the damage will be revealed after scans but the way Ramsey pulled up and made the gesture that indicates the muscle has torn did not augur well. "It looks serious," Wenger said. Arsenal absorbed the setback. They soaked up what West Ham had, they steadied themselves after the wobble and, in Theo Walcott, they had the hero of the final half-hour. The England forward had missed a gilt-edged chance in the first half, one of several Arsenal squandered, but he restored parity at a crucial juncture with a jink and a drive that was spilled by Adrián, the West Ham goalkeeper.

Walcott's second was a wonderfully reactive header after the substitute Lukas Podolski's cross had changed direction slightly at late notice off the head of James Tomkins. Walcott adjusted in a flash to direct a firm header beyond Adrián. West Ham were finally broken. Walcott now has four goals in three matches, after his pair in the 6-3 defeat at City.

There was even the added bonus, from an Arsenal perspective, of Podolski gilding his first appearance since 27 August and a serious hamstring injury with a trademark left-footed thump, after Olivier Giroud had expertly laid off Walcott's cross. Given Giroud's prodigious lone-striker workload, Podolski's return seemed timely.

Wenger felt that his team had answered big questions about their mentality and, also, their title credentials. "Yes, I agree with that," the manager said. "If we hadn't won, we would have had to answer many questions. We've had a difficult period but, honestly, mainly down to the schedule that we've had. The schedule was absolutely horrendous. When you do not win for four games, it is important to come back for the confidence level and win."

It was West Ham who suffered and not only because their injury list swelled further when James Collins was forced off with a calf strain; Ravel Morrison had reported a groin problem on Christmas Eve and did not play. There were regrets when the team failed to capitalise upon their purple patch after half-time but Sam Allardyce did not conceal his worry about how the club's points tally had slipped further behind the number of matches they had played. Much now hinges upon the visit of West Bromwich Albion on Saturday and the New Year's Day trip to Fulham.

Hope had sprung for West Ham when Cole's goal was the prompt for three further chances. With Mark Noble to the fore, Arsenal suddenly looked dishevelled and it was no exaggeration to say they were hanging on.

Noble put Matt Jarvis through only for Wojciech Szczesny to block; Joey O'Brien, completely unmarked, headed wide from Mohamed Diamé's cross and Cole could not finish from the substitute Razvan Rat's centre. You felt at the time that West Ham would live to regret the profligacy. "Three golden chances," said Allardyce, wistfully. "We let it slip through our fingers, haven't we?"

Cole's goal came when Jarvis checked inside Bacary Sagna to cross and, after Mikel Arteta could only half-clear, Kevin Nolan fizzed a shot at goal. Szczesny was partially unsighted but he could only parry and Cole shot home.

Wenger admitted he was worried. His team had enjoyed the better of the first half but could not score. Walcott fluffed his volley from Ramsey's brilliant ball and Giroud dragged badly wide from another Ramsey pass. Santi Cazorla was a persistent menace and Arsenal got in behind the West Ham full-backs. The home team flickered, with Noble's curling free-kick drawing an early save from Szczesny but the breakthrough had not been signposted.

"There is sometimes the guilt flying around the team … when you don't take your chances, you think basically we deserve to be punished and we were," Wenger said. "What happened was that we were under shock because we felt that we should be two or three up."

Arsenal left spaces as they chased the equaliser and Wenger went for broke, with Walcott and Podolski on the wings; Cazorla and Mesut Özil in behind Giroud. Adrián made a double save to thwart Cazorla and Özil but he was overpowered by Walcott. Podolski would be denied at close quarters by Adrián, from Cazorla's pass, before he enjoyed his moment in front of goal. West Ham must find answers.