Arsenal turned on the style in a rampant nine-minute spell to hand Freddie Ljungberg his first win in temporary charge.
The Gunners were woeful in the first-half and went in behind at the break after Angelo Ogbonna’s header deflected in off Ainsley Maitland-Niles.
West Ham were comfortable until the hour mark when an equaliser from Gabriel Martinelli sparked Arsenal into life.
Nicolas Pepe then cut inside before unleashing a fierce drive past David Martin to put the visitors ahead six minutes later.
And Pierre-Emerick Aubameyang then capped the turnaround as he volleyed in to lift Arsenal to ninth in the table.