SAN FRANCISCO (AP) Zac Gallen pitched six hitless innings for his 50th career victory and the Arizona Diamondbacks held on to beat the San Francisco Giants 6-4 on Wednesday night.

Gallen (11-6) had eight strikeouts, threw 63 of 100 pitches for strikes and overcame four walks to win for the second time in six starts.

“For the most part I stuck to my plan,” Gallen said. “I felt like everything was pretty sharp. Feel like I had a pretty good feel for the command for the most part. Even the pitches in the second (inning) that resulted in walks, they were pretty close to where I was trying to go.”

Eugenio Suárez and Pavin Smith hit solo home runs to help the Diamondbacks (79-61) move within five games of the NL West-leading Los Angeles Dodgers. Arizona holds the second NL wild-card spot.

LaMonte Wade Jr. homered and had four RBIs for the Giants. The game drew a season-low crowd of 22,855 to Oracle Park.

Gallen had scuffled for most of a month and had a 4.94 ERA over five starts in August before putting the clamps on the Giants. The 29-year-old right-hander pitched himself into a pair of jams, but worked his way out each time.

Gallen walked the bases loaded with two outs in the second, then retired Curt Casali on a swinging strikeout. The Giants’ Mike Yastrzemski walked leading off the sixth, but Gallen got Heliot Ramos to ground into a double play and struck out Michael Conforto.

“He got very stubborn and did his job,” Diamondbacks manager Torey Lovullo said. “This is a game of adjustments and once he figured it out, figured out a little of the game plan and what their strategy was, that’s when he got really stubborn and started to pound the zone real well.”

With Gallen’s pitch count getting so high early, Lovullo was clear that he had no intention of allowing the starting pitcher to go much longer than he did.

“He knew that there was no chance of throwing a no-hitter,” Lovullo said. “There’s no way I was going to let him throw 145 pitches to throw a no-hitter. It’ll never happen here.”

The Giants didn’t get their first hit until Gallen was gone. Tyler Fitzgerald singled off reliever Kevin Ginkel leading off the seventh, then scored on Wade’s sixth home run of the season.

Ginkel allowed two runs and retired three batters, A.J. Puk struck out the side in the eighth. Justin Martinez gave up two runs in the ninth before getting Brett Wisely to strike out swinging to end it.

Suárez homered off Giants starter Hayden Birdsong in the second. Suárez also doubled in the eighth, barely missing a home run when the ball stuck on top of the center field fence.

“Situationally we weren’t perfect but we did enough at the right times in the right situations to win the game,” Lovullo said.

Smith ended a two-month home run drought with a solo blast off Spencer Bivens in the fifth.

The Diamondbacks began the game with back-to-back walks off Birdsong, then took the lead on Josh Bell’s one-out RBI single.

Birdsong (3-5) battled control issues and lasted only three innings. The rookie had a season-high five walks and allowed two runs while throwing 77 pitches.

Corbin Carroll led off the game with a four-pitch walk for the Diamondbacks, extending his franchise record for reaching base to 43 consecutive games.

CHAPMAN'S CONTRACT

Giants third baseman Matt Chapman agreed Wednesday to a $151 million, six-year contract for 2025-30, giving up his chance to become a free agent after the season. He will get a $1 million signing bonus, payable next year, and annual salaries of $25 million.

TRAINER’S ROOM

Diamondbacks: 2B Ketel Marte (sprained left ankle) did some running before the game and manager Lovullo said he expects the veteran infielder to be activated off the Injured List at some point on the team’s current road trip. Marte has been on the IL since Aug. 19.

Giants: Chapman was originally in the lineup but was replaced so he could get additional rest. … LHP Robbie Ray(left hamstring strain) played catch before the game.

UP NEXT

Diamondbacks RHP Merrill Kelly (4-0, 4.30) opposes Giants LHP Blake Snell (2-3, 3.56) in the series finale Thursday.

---

AP MLB: https://apnews.com/hub/mlb

Copyright 2024 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.