Arsenal won a hugely dramatic clash with Burnley at the Emirates on Sunday thanks to an injury time Alexis Sanchez penalty, after the away side had scored a spot kick of their own just minutes earlier.
Mustafi met a corner with an accurately placed header with just under an hour gone to break the resistance of a typically compact Burnley side and seemingly put the home side in control.
But Granit Xhaka was dismissed for a needless two footed challenge, before Gray dispatched an injury time penalty.
But in the last minute of stoppage time, Ben Mee was penalised for a high foot and Sanchez coolly dinked his penalty past Tom Heaton to secure what had looked an unlikely three points.
In a lively opening, Arsenal were, unsurprisingly, the side on the front foot, although Burnley were less conservative than might have been anticipated.
The hosts had crafted a number of typically intricate openings in the first 20 minutes, before Ashley Barnes tested Petr Cech with a well struck effort from distance at the other end.
That proved to be a rare forage forward for the visitors, but they were efficient and dogged enough in defence to stop any real clear-cut Arsenal chances from presenting themselves as the half progressed.
Sanchez came close to putting the Gunners ahead four minutes before the break, finding himself in space in the box following a free kick, but his effort didn’t have the required curl to find the net.
It seemed a game in which patience would be necessary for the home fans, with Sean Dyche’s diligent outfit more than content to defend with all ten outfield players.
Arsenal began the second half with renewed vigour, Aaron Ramsey attempting to become the third player of the season to score a scorpion kick, before Sanchez drilled an effort narrowly over after a characteristically direct run at goal.
The home side’s pressure was growing, but so was the frustration around the Emirates, particularly when Mustafi saw a vehement penalty appeal turned down by referee John Moss.
But it was Mustafi that was to find the breakthrough just before the hour mark, meeting Mesut Ozil’s corner with a neatly placed cushioned header into the bottom corner.
With Arsenal almost completely dominant following the goal, Xhaka dived recklessly into a challenge on Steven Defour and found himself red carded once again, giving a Burnley side that had looked bereft of ideas some hope.
It was the home side’s turn to show some defensive steel, and they remained relatively comfortable despite their numerical disadvantage.
Burnley inevitably committed more players forward, but, other than a flick on that almost fell to Barnes, were unable to capitalise on Xhaka’s dismissal.
But, with the game in injury time, Barnes was tripped by substitute Francis Coquelin and a penalty was awarded.
Gray drilled the ball directly down the middle of Cech’s goal from the spot, leaving Arsenal to seemingly regret their lack of discipline.
But more drama was to come. Mee was penalised for a high foot on Laurent Koscielny and Sanchez cooly dispatched his penalty to send Arsenal second in dramatic fashion.