The Gunners had seen their unbeaten start to the new season ended by a 2-1 home defeat against leaders Chelsea last weekend.
However, Arsene Wenger’s men, who beat Olympiacos in the Champions League on Wednesday night, showed great character to recover from conceding an early goal to Mohamed Diame.
France striker Olivier Giroud, a £12million summer signing from Montpellier, scored his first Premier League goal from close range just ahead of half-time, with substitute Walcott slotting home another on the break before the industrious Cazorla struck a superb 25-yard effort.
Arsenal left-back Kieran Gibbs, though, limped off in the second half, which could be a concern for England, although West Ham striker Andy Carroll did complete the full 90 minutes on his recovery from a hamstring problem.
Before kick-off, there was a well-observed minute’s applause for former West Ham defender John Bond, who passed away recently.
Arsenal started brightly as the recalled Giroud sent in a low shot from 20 yards which forced Jussi Jaaskelainen into action, before Cazorla had a goalbound shot blocked.
West Ham looked to utilise Carroll’s presence whenever possible, but needed all the help they could get in their own penalty area as Arsenal continued to press.
First, Carl Jenkinson’s cross was hacked behind and then Carroll knocked Cazorla’s fierce drive over his own crossbar.
West Ham, though, snatched the lead against the run of play in the 21st minute.
The ball was worked down the left channel and Diame cut inside Aaron Ramsey to fire an angled drive into the top corner.
The Senegal midfielder was shown a yellow card for celebrating his first Irons’ goal by running into the crowd – and was fortunate not to have then seen red after clattering into Mikel Arteta, instead just getting a final warning from referee Phil Dowd.
West Ham were now on the front foot, with Carroll’s close-range header straight at Vito Mannone.
Arsenal had a chance to equalise when Giroud just failed to connect with Per Mertesacker’s flicked header through the six-yard box.
The French striker, though, did bag his Premier League goal four minutes before half-time.
After winning the ball in midfield, Giroud stabbed it out to Lukas Podolski on the left. The German darted to the byline before cutting the ball back across goal – where Giroud arrived at pace to slot home.
West Ham, though, could easily have gone back in front just before the break when Kevin Nolan knocked the ball wide from close range after a free-kick into the Arsenal penalty area.
The Irons were fired up following the restart, forcing a succession of corners.
Arsenal left-back Gibbs hobbled off in the 55th minute, replaced by Brazilian Andre Santos – an injury concern for England ahead of their World Cup qualifiers.
Ryan Jarvis’ shot-on-the-turn flew over as the hosts pressed again.
As the hour mark passed, Ricardo Vaz Te had to be substituted, by Matthew Taylor, after falling awkwardly on his arm after racing to a 50/50 with the Arsenal keeper.
Wenger looked to inject some fresh life into the visitors’ attack when he sent on Walcott for Gervinho.
Walcott almost helped set up a goal when Cazorla’s shot hit Ramsey and bobble in West Ham penalty area, his clever backheel was cut into the sidenetting by Giroud from a very tight angle.
The Irons went close moments later as Carroll knocked a deep cross wide after getting above Mannone.
The game was wide open now as both sides created chances, Cazorla firing off target after a jinking run before Mertesacker’s last-gap tackle denied Nolan.
At the other end, Podolski’s low drive was spilled behind by Jaaskelainen.
Arsenal broke away to take the lead with 13 minutes remaining.
Giroud fed Walcott, who timed his run to beat the offside trap, dart into the penalty area and beat the keeper with a low shot into the near post.
West Ham quickly spurned a chance to draw level when Nolan blasted over from 10 yards.
With 11 minutes left, Diame was replaced by Carlton Cole.
However, it was game over when, in the 83rd minute, the excellent Cazorla finally got his goal – lashing a sublime left-foot effort into the top-right corner from 25 yards.