Gallo, who entered 2 for 23 in six games since the Yankees acquired him from Texas, lofted a 1-0 slider from Paul Sewald (6-3) just over the short porch in right field.
''A big night for him, but the way I look at it, he's been having good at-bats every night,'' New York manager Aaron Boone said. ''The defense has been there. You're seeing the athleticism. He's grinding at-bats. So for me it was kind of a matter of time where he really broke through and obviously hit one out of the park and a huge one at that, but I think he's looked very good in the first week, frankly.''
After two-strike singles by Aaron Judge and Giancarlo Stanton, Gallo watched his drive stay inside the foul pole and pumped his fist while rounding first before completing his trot around the bases.
''I was just hoping that it would stay fair and I was just hoping it would get out,'' Gallo said. ''Once I saw it get out, I was just overcome with emotion.''
Gallo, who also doubled twice, waved from the dugout to the adoring crowd, which continued to chant his name as he jogged out to left field for the eighth.
''It's always nice to hit a homer, it's a little bit nicer to hit a game-winning homer,'' Gallo said.
Gallo's 26th of the season helped the Yankees win for the sixth time in seven games and move a season-high 10 games over .500. Both New York and Seattle are chasing the AL wild-card spots currently held by Boston and Oakland.
According to the Elias Sports Bureau, Gallo is the fourth Yankees player in the last 20 seasons whose first five hits with the team went for extra bases. He also tied a career high by getting three extra-base hits for the third time.
''He's been playing really good but I think everybody loved what he did tonight,'' said infielder Rougned Odor, Gallo's former teammate in Texas.
Chad Green (5-5) worked two innings in relief of starter Nestor Cortes Jr. Zack Britton pitched the eighth and Aroldis Chapman allowed two baserunners in the ninth before retiring Mitch Haniger on a flyball to the warning track in left field for his 23rd save in 27 opportunities.
''A little nervous there,'' said Boone, who had Jonathan Loaisiga warming up.
Seattle rookie Jarred Kelenic homered in the seventh off Green, giving Seattle a 3-2 lead. In the fourth, Haniger had a sacrifice fly and Kyle Seager homered for the Mariners.
The Mariners fell to 3-4 on their 10-game road swing and took their third loss on the trip decided in the seventh inning or later.
''We played a really good ballgame,'' manager Scott Servais said. ''I thought we were in a great spot trying to hang onto that thing.''
Cortes allowed two runs over five innings in his fourth start this season. He ended his night by retiring Seager on a grounder into the shift with two on.
Seattle starter Tyler Anderson also gave up two runs in five innings.
Anthony Rizzo went 0 for 4 with three flyouts, ending his streak of six games with at least one RBI to begin his Yankees career. Rizzo was the fourth player to drive in a run in each of his first six games with a new team in the last 70 years and the first since Bobby Murcer in his first seven games for the Chicago Cubs in 1977.
Rizzo did make a nice scoop at first base on Odor's throw for the first out of the ninth.
''I think it's comforting knowing you've got someone that's really elite at that,'' Boone said.
Yankees: OF Clint Frazier (vertigo) took seven at-bats at the team's minor league complex in Tampa, Florida. Frazier also went through defensive drills and ran the bases. ... RHP Corey Kluber (strained right shoulder) threw a bullpen and will face hitters Saturday. ... LHP Wandy Peralta was reinstated from the COVID-19 list after being out since July 15. . Third-base coach Phil Nevin exited in the second inning for undisclosed reasons. Boone said it was not COVID-19 related and Nevin returned to the dugout by the end of the game.
LHP Marco Gonzales (3-5, 5.15 ERA) starts for Seattle on Friday. The Yankees had not announced a starter and a bullpen game is possible.
More AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP-Sports
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.