The Gunners came away with their heads held high in a confident win in an intriguing London derby where both sides were planning to stake their claim for a spot in the Champions League.
The first 45 minutes produced a cagey affair high on quality and astute defending, with David Moyes' back up centre backs Craig Dawson and Issa Diop putting in an impressive shift.
Their fortitude didn't last long in the second half though, with default captain Alexandre Lacazette following up a fine opening half with a neat assist to Martinelli.
The Brazilian slotted the ball in giving Lukasz Fabianski no chance, and soon after Lacazette had the chance to make the armband his own.
Vladimir Coufal took down the striker with a crucial last ditch challenge in the West Ham penalty area, but replays showed it was a gift, with justice served as Lacazette placed the spot kick right into Fabianski's hands.
Smith Rowe had just been called upon to inject some energy into the game, and did so brilliantly with three minutes left, seeing a fine run finished with an brilliant goal.