In CCTV footage obtained by the Daily Mail, the 23-year-old centre-back and a friend are seen being confronted by two men who attempt to steal his Mercedes and his watch.
Abderaham Muse, who has been named as one of the attackers, lunged at the Brazilian with a bat.
Gabriel, though, struck him in the face, grabbed his hat and wrestled with him before the attacker eventually ran away.
Muse was jailed for five years last month after police were able to identify him using DNA from the hat.
Prosecutor Martin Lewis told Harrow Crown Court: "No injuries were suffered but a great deal of shock was caused. They happened to pick on two victims who were very fit and able to look after themselves."
Meanwhile, Judge Anupama Thompson told Muse: "While you didn't specifically target the victim on account of him being a well-known footballer, there was a realisation this person was wealthy and worthy of robbing.
"You saw a nice car and a nice house and thought it was rich pickings. Fortunately, thanks to the brave actions of the people you targeted, no further damage was done."
Gabriel joined Arsenal from French side Lille in 2020 for £27 million and has been one of manager Mikel Arteta's most consistent players.
The Brazilian defender has played 42 times since joining the club and in the last 10 league games for the Gunners, has been part of a defence that has conceded just eight goals.
Speaking of the incident ahead of the Premier League match against Manchester United, manager Mikel Arteta praised the player's courage.
"Obviously it's not a nice thing to go through when you have family involved and they're trying to access your own house.
"Gabi showed a lot of character, you see the reaction that he had straight away. Credit to the boy.
"And after that he was fine. Obviously he was shocked and there were a few other things that he wanted to change in his life to prevent those things happening again.
"The club has given him all the support he's needed to try to forget about this situation, learn from it and move on."