Pablo Sandoval and Brandon Belt hit solo home runs to lead the San Francisco Giants over the Arizona Diamondbacks 8-5 Saturday night.

Madison Bumgarner (3-4) pitched 6 1/3 innings, allowing four runs and five hits with six strikeouts. He won for the third time in his last four starts.

More Images
Arizona Diamondbacks' Nick Ahmed (13) is congratulated by teammate David Peralta, left, and manager Torey Lovullo, right, after scoring against the San Francisco Giants during the seventh inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

Pablo Sandoval and Brandon Belt hit solo home runs to lead the San Francisco Giants over the Arizona Diamondbacks 8-5 Saturday night.

Arizona Diamondbacks shortstop Nick Ahmed, left, tags out San Francisco Giants' Joe Panik on a steal attempt during the fourth inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

Belt's home run, also off Andriese, splashed down in the pool beyond right field in the top of the ninth with two outs.

Arizona Diamondbacks starting pitcher Zack Godley throws to a San Francisco Giants batter during the first inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

San Francisco turned a 1-0 lead into 4-0 on Steven Duggar's RBI triple, Buster Posey's RBI single and Brandon Crawford's sacrifice fly.

Arizona Diamondbacks Hall of Fame pitcher Randy Johnson throws out the first pitch prior to a baseball game between the Diamondbacks and San Francisco Giants on Saturday, May 18, 2019, in Phoenix. The Diamondbacks were marking the 15th anniversary of Johnson's perfect game against the Atlanta Braves. (AP PhotoRalph Freso)

The Diamondbacks cut the lead back to 6-4 and had runners at the corners in the seventh but couldn't add more in that inning.

San Francisco Giants starting pitcher Madison Bumgarner throws to an Arizona Diamondbacks batter during the first inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

INJURY SETBACK

Sandoval pinch-hit in the eighth inning with two out and drove a 2-2 pitch from Matt Andriese over the right field fence for his second career pinch-homer.

Arizona Diamondbacks' Nick Ahmed (13) is congratulated by teammate David Peralta, left, and manager Torey Lovullo, right, after scoring against the San Francisco Giants during the seventh inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

Arizona Diamondbacks' Nick Ahmed (13) is congratulated by teammate David Peralta, left, and manager Torey Lovullo, right, after scoring against the San Francisco Giants during the seventh inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

Belt's home run, also off Andriese, splashed down in the pool beyond right field in the top of the ninth with two outs.

Eduardo Escobar homered and became the first Diamondback to 10 home runs on the season. Carson Kelly hit his third home run, and Adam Jones added two RBIs.

Zack Godley (1-4) has allowed four or more earned runs in five of his eight starts this season and hasn't made it beyond four innings in each of the last four. That included Saturday, when the Giants reached four runs off Godley in the third inning.

Arizona Diamondbacks shortstop Nick Ahmed, left, tags out San Francisco Giants' Joe Panik on a steal attempt during the fourth inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

Arizona Diamondbacks shortstop Nick Ahmed, left, tags out San Francisco Giants' Joe Panik on a steal attempt during the fourth inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

San Francisco turned a 1-0 lead into 4-0 on Steven Duggar's RBI triple, Buster Posey's RBI single and Brandon Crawford's sacrifice fly.

After Godley walked Bumgarner with one out in the fourth and heard boos from the crowd, manager Torey Lovullo removed him. Godley lasted 3 1/3 innings, allowing four runs and six hits.

Escobar's home run led off the fourth, and the Diamondbacks made it 4-2 when Jones singled in Blake Swihart from second base with two outs.

Arizona Diamondbacks starting pitcher Zack Godley throws to a San Francisco Giants batter during the first inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

Arizona Diamondbacks starting pitcher Zack Godley throws to a San Francisco Giants batter during the first inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

The Diamondbacks cut the lead back to 6-4 and had runners at the corners in the seventh but couldn't add more in that inning.

RANDY'S NIGHT

The Diamondbacks commemorated the 15th anniversary of Hall of Famer Randy Johnson's perfect game against Atlanta. Fans received a Johnson figurine, and Johnson threw out the ceremonial first pitch.

Arizona Diamondbacks Hall of Fame pitcher Randy Johnson throws out the first pitch prior to a baseball game between the Diamondbacks and San Francisco Giants on Saturday, May 18, 2019, in Phoenix. The Diamondbacks were marking the 15th anniversary of Johnson's perfect game against the Atlanta Braves. (AP PhotoRalph Freso)

Arizona Diamondbacks Hall of Fame pitcher Randy Johnson throws out the first pitch prior to a baseball game between the Diamondbacks and San Francisco Giants on Saturday, May 18, 2019, in Phoenix. The Diamondbacks were marking the 15th anniversary of Johnson's perfect game against the Atlanta Braves. (AP PhotoRalph Freso)

INJURY SETBACK

Diamondbacks right-hander Taijuan Walker isn't going to throw for at least six weeks after suffering a shoulder injury during a rehab start earlier in the week.

Walker received a platelet-rich plasma injection in his shoulder, which will delay his return from major elbow surgery that was on track for midway through this season. He made only three starts in 2018.

San Francisco Giants starting pitcher Madison Bumgarner throws to an Arizona Diamondbacks batter during the first inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

San Francisco Giants starting pitcher Madison Bumgarner throws to an Arizona Diamondbacks batter during the first inning of a baseball game Saturday, May 18, 2019, in Phoenix. (AP PhotoRalph Freso)

"I don't want to push through it and make it worse," Walker said. "I don't think it's bad enough for surgery. It's just swelling."

HOT CORNER

Both teams got highlight-reel defensive plays from their respective third basemen. Evan Longoria took a hit away from Ketel Marte to end the fifth, and Escobar snagged Kevin Pillar's hard line drive on the fly in the sixth.

TRAINER'S ROOM

Giants: RHP Johnny Cueto threw a bullpen session off flat ground before Saturday's game, and the Giants were encouraged enough by what they saw for manager Bruce Bochy to say that Cueto could come back from Tommy John surgery before the season ends. Cueto had elbow reconstructive surgery last August.

Diamondbacks: RHP Zack Greinke is on track to make his next scheduled start, Tuesday at San Diego, on five days' rest, after a bullpen session that Lovullo said went well Saturday. Greinke had an MRI on Friday that revealed no damage to his abdominal area after he left his last start with a trainer. ... OF David Peralta was held out of the lineup after aggravating pain in his upper back and shoulder area Friday night.

UP NEXT

Giants: Bochy said LHP Drew Pomeranz is set to come off the injured list and start Sunday's series finale against Arizona. Pomeranz (1-4) went on the 10-day injured list on May 9.

Diamondbacks: LHP Robbie Ray (3-1) faces the Giants with a 4-1 career mark against them. He's 3-0 with a 1.98 ERA in his last five starts this season, and has 35 strikeouts.

---

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports