Kai Havertz scored the winner with four minutes to go as Arsenal beat Brentford 2-1 - but only after the forward avoided a second yellow card for simulation earlier in the half.
A Declan Rice header put the Gunners ahead on 19 minutes, before Yoane Wissa showed great work rate and endeavour to close down Aaron Ramsdale and deflect in the equaliser in first-half stoppage-time.
Havertz, having been booked for a foul in the opening 45 minutes, dived over Nathan Collins' challenge in the second period, and the referee opted not to send him off.
And then, on 86 minutes, the Arsenal forward headed home Ben White's cross to win the game for his side and send the Gunners to the top of the Premier League.
Rice header puts Arsenal ahead before Wissa equalises in stoppage-time
Thomas Frank made one change to the team that drew 2-2 with Chelsea, as Keane Lewis-Potter replaced Sergio Reguilón in the starting XI. Frank confirmed that the Spanish left-back was missing due to a minor hamstring injury.
Mikel Arteta made two switches to his Arsenal side: David Raya, unavailable against his parent club, was replaced by Ramsdale; Gabriel Martinelli also dropped out, with Leandro Trossard coming in.
The hosts dominated possession in the opening stages, with Bukayo Saka frequently receiving the ball and looking to get to the byline and put in a cross.
Brentford's first chance came on 10 minutes, when Wissa was pulled back by Gabriel on the edge of the area. Keane Lewis-Potter's delivery to the back post looked a good one, but no one could get on the end of it.
The Bees had another set-piece soon after, this time a corner, but it was the north Londoners who almost carved an opening from it. A Christian Nørgaard header went straight into Ramsdale's arms and the keeper started an instant counter attack with a long ball through to Trossard. It looked like the Belgian was in on goal but for some quick and clever defending from Mads Roerslev, who eventually won a goal kick for his side.
But the Gunners did take the lead soon after, on 19 minutes, through Rice. A Ben White cross was curled into the box from deep, and the England international rose highest inside the penalty area to head home the opener.
Havertz had a great chance to double Arsenal's lead 10 minutes before the break. A ball over the top from Rice was fed into the forward, who beat the offside trap and was one-on-one with Flekken. He lifted the ball over the Bees keeper, but it dropped just wide of the far post.
And it was Brentford who delivered the final blow of the first half. Gabriel rolled a pass back to Ramsdale and Wissa chased down what appeared to be a lost cause. As the keeper had possession inside the six-yard box, Wissa slid in as he attempted to clear, which saw the ball deflect off him and into the back of the net.
Havertz fortunate to avoid second yellow card before scoring late winner
Toney almost scored one of the goals of the season on 55 minutes. A ball over the top was bouncing just ahead of the centre-forward, 45 yards from goal. He looked up, saw Ramsdale off his line, and struck it with the outside of his boot, but a great save from the back-pedalling Gunners stopper kept it out.
The hosts were pushing, though. Multiple corners rained down on the Brentford goal, only for the west Londoners to continually get them clear.
Havertz was lucky to escape a second yellow card, after he was booked in the first half. He dived over the challenge of Collins, but the referee decided not to send the Gunners forward off for simulation.
Collins had a fantastic chance to make it 2-1 to the visitors, when he met Kristoffer Ajer's curling cross with his head from close range. Again, a full-stretch Ramsdale stop prevented the Bees from taking the lead.
Rice almost doubled his tally with 15 minutes left at the Emirates, as he opened up his body and struck a fantastic effort from the edge of the box towards the top-right corner. It beat Flekken but crashed back off the post.
Havertz then scored the winner with five minutes to play. A cross from White found the German inside the area and he headed past Flekken to win the game and send the hosts to the top of the league.
Arsenal: Ramsdale, White, Saliba, Gabriel, Kiwior (Zinchenko 80), Jorginho (Jesus 70), Ødegaard (Partey 90+), Rice, Saka, Havertz, Trossard (Nelson 80)
Subs not used: Hein, Cédric, Vieira, Smith Rowe, Nketiah
Brentford: Flekken, Zanka (Damsgaard 90), Ajer, Collins, Roerslev, Oneyka (Yarmoliuk 78), Nørgaard (Jensen 34), Janelt (Ghoddos 90), Lewis-Potter, Wissa (Maupay 78), Toney
Subs not used: Strakosha, Ji-soo, Arthur, Baptiste
Attendance: 60,331
Frank: Arsenal performance should make Brentford fans unbelievably proud
Despite defeat, Brentford head coach Thomas Frank stated how proud he was of his Bees players after an "incredible" performance against top-of-the-table Arsenal.
"The mentality, the effort, the shift, the personality this team is showing should make all the Brentford fans unbelievably proud," Frank stated.
“How much they fought for the badge was incredible, against the in-form team in the Premier League. Everyone, rightly so, was praising Arsenal; they have scored however many goals in the last seven games and we kept them to a very, very, very minimum.
“You could argue that we had the bigger chance, with Nathan Collins at 1-1 in the second half.
“And, of course, it’s very clear that [Kai] Havertz should have a clear second yellow and then he would have a red card and not be able to score the winner. We'd then play 11 against 10, and that would have given us an even bigger chance to win the game.”
Janelt: We fought for each other for 90 minutes
Midfielder Vitaly Janelt expressed his frustration at Brentford’s narrow defeat to Arsenal, but insisted the Bees’ can take plenty of positives from their performance at Emirates Stadium.
“We’re disappointed,” he said. “We put a great shift in and had a really big chance for Nathan [Collins] from a cross from [Kristoffer] Ajer. It was a big chance to score to lead 2-1. It was a great shift, but we didn’t get the points.
“Right now, I don’t think momentum is with us. Everyone expected that Arsenal would win by three, four, five today because of their last results, but everyone knows how difficult it is to play against us either at home or away.
“They didn’t create many chances and, for me, it was a clear yellow and then red to Havertz; it was a clear dive for me. Then he scores the winner, but that’s football.
“The goal for Wissa shows how hard we work - we never stop. Arsenal away, we still pressed them high and tried everything to score."