In footage obtained by the Daily Mail, the 23-year-old centre-back and a friend are 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 struck him in the face before grabbing his hat and wrestling 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, four of which game against Liverpool.