Arsenal fell behind to a Matt Jarvis header on 40 minutes but an Olivier Giroud strike and two goals from Lukas Podolski secured the home side a much-needed win
Matt Jarvis silenced the home fans on 40 minutes when he headed the visitors in front, but an Olivier Giroud strike and a double from Lukas Podolski got the Gunners the result they needed.
And afterwards Wenger was keen to pay tribute to the "mental response" of his players to their poor recent run of form and to going behind against the Hammers.
"I think we got the victory tonight through the consistency in our game," the Frenchman told Sky Sports.
"Even in the first half it was difficult but the vital thing was to come back to 1-1 just before half-time, and after the second half we controlled the game well.
"Overall it's a hard-fought win but a very, very important one, and as well a very pleasant one because after Saturday we had to dig deep, and they did that with a great mental response."