After an unexpectedly close encounter, Declan Rice dramatically scored a 97th-minute winner as Arsenal overcame a resilient Luton side.
On the stroke of half-time, Gabriel Jesus scored a header of his own to restore the Gunners' advantage as they entered the break with a narrow but deserved lead.
The second half started as something of a nightmare for the visitors as Luton drew level after another corner, this time scored by Elijah Adebayo, before a David Raya mistake enabled Ross Barkley to fire the hosts ahead in the 57th minute.
From here on the Gunners dominated and found themselves level just minutes later thanks to a nicely-worked Kai Havertz strike, and they continued their relentless attacking for almost the entire remainder of the game.
As the game looked to be slipping away from Mikel Arteta's side, a late, last-gasp free kick led to a floated cross from Martin Odegaard finding Declan Rice, whose effort found the back of the net to give a sensational win to the visitors - while crushing Luton hearts in the process.
Story of the game
Arteta made three changes of his own to the Arsenal side who beat Wolves 2-1 at the weekend, which saw the surprise omission of Oleksandr Zinchenko after his error, as well as confirmation that Takehiro Tomiyasu is sidelined.
Arsenal started the game very much on the front foot as they looked to test Luton from the first whistle.
Despite this early pressure, the Luton defence held strong and prevented so much as a single shot in the opening exchanges, with the hosts even enjoying their fair share of possession.
There was an early injury scare for the Gunners as Martinelli went down, clearly in pain, after taking a knee to the lower back. Thankfully for Arteta's side, the Brazilian was able to continue after a brief period of treatment.
After settling into the game, Luton began to create a series of chances and, at times, looked to be testing the Arsenal defence, though they were able to deal with the threats posed at them.
Arsenal were noticeably struggling to play through a compact and organised Luton side, which was not aided by the smaller size of the pitch at Kenilworth Road.
Luton were working tirelessly and frustrating the league leaders with excellent relentless pressing, which saw them able to contain the dangerous Arsenal side, much to the annoyance of the away fans and players alike.
Despite Luton's excellent work, the Gunners were able to find a way through after a misplaced pass back forced Thomas Kaminski to play the ball out for an Arsenal throw-in.
From here Saka was able to dribble into the box with a degree of ease and played it calmly across to Martinelli, who was able to send it into the back of the net to give the visitors a hard-fought lead.
Arteta's side responded well to this setback and looked threatening on the attack straight from kickoff, but were unable to carve any significant chances to retake the lead.
In the 31st minute, Martinelli fired a good effort goal-wards and forced an equally impressive save from Kaminski, which kept the score level.
There were a series of bookings throughout the half as the game became a bit scrappy from both sides, with several fouls being committed across the pitch - with the referee needing to retake control of the proceedings.
As the first half looked to be drawing to a somewhat dull conclusion, White went on a charging run behind the defence where he was able to play a pinpoint cross into the path of Jesus, who headed home to restore the Gunners' lead.
This goal would prove to be the last significant action of the half, with the referee bringing proceedings to an end shortly later - with Arsenal protecting a narrow 2-1 lead.
Neither manager saw any need to make changes at the break, as they both looked to up their game in the second half.
Arsenal started the second half much like the first - on the front foot and looking to attack right from the off.
Despite the Gunners' attacking intent, they found themselves pegged back in the 50th minute, from another corner.
Adebayo got away from Declan Rice and, after Raya came out to try, and failed to, claim the ball, the English striker was able to head the ball into an open net to bring his side level.
While Arsenal were hoping to once again reassert their lead in the game, they found themselves desperately defending against a dangerous Luton attack.
Ross Barkley cut into the box and, after beating a handful of defenders, placed his shot beneath Raya who was powerless to stop it despite the shot being straight towards him - which saw the former Chelsea midfielder miraculously put his side ahead against the league leaders.
Like a reverse of the first half, it was Luton who found themselves conceding while still on the high of celebrating their goal.
This time it was another ex-Chelsea midfielder, Havertz, who found the back of the net after some excellent play from Jesus to find the German in the box, who took his shot excellently.
From here on it was one-way traffic as Arsenal pushed to find a winner but, as the game progressed, they continued to be frustrated by the seemingly tireless Luton defence.
Substitute Leandro Trossard had an excellent chance to put his side ahead, as he received the ball in the box following some superb work from Saka, but the Belgian's powerful effort was deflected over the bar for a corner.
Just a few minutes later, the Gunners saw two penalty appeals denied by VAR, despite what fans perceived to be an obvious pulling of Gabriel's shirt from a corner.
As the game drew to a close, it was the visitors who continued to control the game, as Luton were clearly willing to accept a draw, and Edwards' side defended excellently to shut out the struggling Arsenal side.
Arsenal had a number of chances late on but were unable to make any meaningful chances as the clock wound down, until one of the last kicks of the game.
Arsenal won a free-kick in the middle of the park and the whole team went forward to desperately try and find a winner. Odegaard floated a cross into the box which found Rice, who bundled the ball into the back of the net to send the away end into oblivion and win the game literally at the last chance.
Player of the match - Gabriel Jesus
In a game with seven goals, and seven goal-scorers, it is perhaps a little difficult to highlight a single player's performance, but Jesus just about edged it over the others, although a special mention should be given to Kaminski.
But, back to the Brazilian, and he was an integral cog in Arsenal's side against Luton as they came back to rescue a late win and extend their advantage at the top of the table.
His headed goal was executed perfectly and his assist was off the back of an outstanding piece of play from the 26-year-old. Especially after recently coming back from injury, it was a performance to behold, especially for a striker for whom goals are "not my strong point."