WATCH Arsenal TV on beIN SPORTS | via Foxtel, Kayo Sports, Fetch TV and beIN SPORTS CONNECT
The 21-year-old is into his fourth season at Emirates Stadium after joining from Ituano in July 2019.
Brazil international Martinelli has made 111 appearances for Arsenal and has started all 19 of its league matches this campaign, making him one of seven ever-presents.
He was due to be out of contract at the end of next season, but terms have now been agreed on a deal that will reportedly run through until the end of the 2026-2027 campaign.
Arsenal announced the news on its official website, with manager Mikel Arteta confident there is still more to come from the youngster.
"We're delighted Gabi has signed a new long-term contract," Arteta, whose side is five points clear of Manchester City in the Premier League with a game in hand, said.
"Our supporters see his quality and energy every single time he puts on the shirt and he's the same every day in training, with his hard work and positive values.
"Gabi is still very young, so we know there's still much more to come from him and it's great that we'll be on this journey together.
"We're now excited to continue to develop his huge talent and look forward to seeing him perform with Arsenal in the years to come."
Martinelli has seven goals in 27 appearances for Arsenal this season – only Eddie Nketiah (nine), Martin Odegaard and Bukayo Saka (both eight) have more – while assisting a further three.
The former Corinthians youth player is one of several young players Arsenal is looking to tie down, with talks also under way with William Saliba and Saka.
"It's great that Gabi has signed a new contract with us," sporting director Edu added.
"The foundations of our squad continue to be built on young talent, so it's great that Gabi has signed a new contract.
"Gabi is still just 21, and a player with big ability and personality. He is an important part of our future and we're delighted that we have agreed a new contract."