Rafa Benitez’s side had gone eight games without a win in the league, and that seemed to continue when Martin Odegaard put the Gunners ahead.
But Richarlison equalized with ten minutes left and Gray shot a stunning winner as Everton turned on a really poor Arsenal side.
It was a first half that was sorely lacking in quality for much of the 45 minutes.
Ben Godfrey was fortunate not to be sent off, after appearing to stomp on Takehiro Tomiyasu’s face while the defender was on the ground. VAR decided that no action was necessary.
Everton believed they took the lead after 44 minutes. Richarlison led Andros Townsend’s free kick, but it was denied for a tight offside.
And they must have regretted it, when Arsenal suddenly erupted seconds before the break. Kieran Tierney burst in from the left and put a nice cross into the box, and Odegaard stole it past Pickford.
VAR’s offside decision would come to Arsenal’s aid again in the second half.
Abdoulaye Doucoure played the game up to Richarlison who beat Aaron Ramsdale, but was refused again, this time by an even tighter margin.
But Arsenal continued to fall deeper, and they were punished. Demarai Gray’s curling effort crashed into the bar, and Richarlison was on hand in the box to regain the rebound ten minutes from time.
The Gunners were woken up by the goal and missed a huge opportunity to regain the lead. Bukayo Saka rolled up a beautiful ball at the far post, but Eddie Nketiah sort of headed against the post a few yards away.
Odegaard brilliantly blocked two efforts late, before Gray produced a moment of magic, slicing in and digging an effort into the top corner of the post to send Goodison wild.
Pierre-Emerick Aubameyang came off the bench and missed a huge opportunity with the game’s final kick, as Arsenal’s lower display saw them leave with nothing.