Michail Antonio was handed his third start of the season in place of Sebastien Haller in one West Ham change to the side that lost 2-0 at Wolves last time out.
Interim boss Freddie Ljungberg made four changes changes to the Arsenal side since the shock 2-1 home defeat to Brighton.
Kieran Tierney replaced Sead Kolasinac at left-back; Calum Chambers partnered Sokratis in defence as David Luiz dropped to the bench.
Gabriel Martinelli made his first Premier League start as Alexandre Lacazette dropped to the bench while Nicolas Pepe replaced Joe Willock.
Ljungberg was forced to make another late change ahead of kick-off when Hector Bellerin picked up an injury in the warm-up and Ainsley Maitland-Niles was drafted in.
Following a slow start between two London rivals struggling for form, it was Pablo Fornals who had the first effort on target in the 26th minute when he picked up a clearance just outside the area and saw his strike comfortably held by Bern Leno.
The Gunners were hit by another defensive injury blow just before the half hour when Tierney went to ground holding his shoulder and was replaced by Kolasinac.
Arsenal had a chance on 33 minutes when Pierre-Emerick Aubameyang did well to chip the ball into the middle from the left but Mesut Ozil could only guide his header over the top.
The Hammers responded within a minute as Antonio pounced on a poor clearance from Chambers and he drilled in an effort which had Leno down to his left to make a smart save.
The hosts did take the lead on 38 minutes when Declan Rice picked out the run of Fornals down the right and his cross into the middle was met by Angelo Ogbonna whose close-range header deflected off Maitland-Niles on its way past a wrong-footed Leno.
There was a quick Video Assistant Referee (VAR) check to see if the ball hit Ogbonna’s arm, but the goal was good.
A sloppy pass by Granit Xhaka across the pitch inside his own half gifted an opportunity to Snodgrass on 55 minutes, but the Scot’s eventual strike from the right of the area took a deflection off Sokratis as it looped over Leno and dropped just wide of the far post.
Snodgrass turned provider moments later when he laid the ball into the path of Rice on the edge of the box, but the midfielder’s first-time effort was well held by Leno.
The Gunners grabbed an equaliser out of nothing on the hour when Kolasinac surged forward and played a teasing ball into the middle of the box for young league debutant Martinelli to fire a low right-foot effort beyond David Martin.
The game was turned on its head in the 66th minute when Pepe picked up the ball wide on the right before cutting inside and curling a wonderful left-foot strike into the far top corner of the net from the edge of the area.
The night got even better for the Gunners three minutes later when Ozil picked out Pepe on the right and his chip into the middle dropped to Aubameyang hooked the ball past Martin from close range.
Aubameyang almost grabbed his second and the Gunners’ fourth inside seven minutes of injury time but his goalbound strike deflected over the top off the boot of Ryan Fredericks.
Having ended their worst winless run since 1977 Arsenal move up to ninth position – two points behind Manchester United in fifth.
The Hammers’ fifth consecutive home game without a win leaves them in 16th place and just a point ahead of third-bottom Southampton.