Matt Jarvis headed the Hammers in front at Emirates Stadium five minutes before half-time but Lukas Podolski levelled with a shot on the turn four minutes later.
Olivier Giroud’s classy touch and finish gave the Gunners the lead in the 55th minute, before Podolski powered home a second to wrap up victory 12 minutes from time.
It was a hard-fought win and a very enjoyable win as we had to dig deep on Saturday
The win left Arsenal a point above fifth-placed Everton, who host Crystal Palace on Wednesday.
And Wenger was delighted to see his side notch up just their second win in seven Premier League outings.
“I think we built the victory tonight through consistency in our game,” Wenger told Sky Sports.
“The vital thing was to come back to 1-1 before half time. It was a hard-fought win and a very enjoyable win as we had to dig deep on Saturday.
“We were under absolute pressure to win the game, on top of that it was a derby and after giving a lot on Saturday it was difficult.
“Maybe we could have scored more, I was satisfied with the mental response of the team tonight, the focus tonight of the team was outstanding.
“We showed maturity not to panic when we went 1-0 down, I had to rest a number of players tonight but it was good that players like Kim Kallstrom managed to contribute tonight.”
Wenger also praised substitute Aaron Ramsey, who set up Podolski’s second goal with a cushioned header.
“Aaron Ramsey is a very important player for us, he has that power and that drive,” he continued. “He also surprises you with his vision in the final third.”
Asked about the top-four race, Wenger added: “Everyone is under pressure to do well, the best thing to do is to focus on your own performances and see where that takes us.”
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news