PHOENIX (AP) Brandon Belt's 100th career homer was one timely shot for San Francisco.
Andrew McCutchen opened the 10th with a single against Brad Boxberger. Buster Posey then struck out swinging and Evan Longoria flied to center before Belt hit a towering drive into the seats in right for his second homer this season.
''I totally forgot about it,'' Belt said of his milestone. ''But I guess it's a pretty good way to spend your 100th home run.''
The ball was corralled by a Giants fan, Belt said, and he traded a bat for the memento.
''Nice for our offense to go out and get some timely hits, score some runs and win that ballgame,'' he said.
Boxberger (0-1) had opened the season with seven scoreless appearances of an inning apiece. Hunter Strickland (2-0) got the win despite blowing a save chance.
''Right pitch, just left it up and he didn't miss it,'' Boxberger said.
Arizona rallied in the bottom half of the 10th. Pinch-hitter John Ryan Murphy and David Peralta began the inning with consecutive doubles against Cory Gearrin.
The Diamondbacks had runners on the corners with one out when Gearrin struck out A.J. Pollock. Daniel Descalso then walked before Alex Avila grounded out, giving Gearrin his first save.
Longoria hit a two-run homer in the sixth, snapping San Francisco's 21-inning scoreless streak, and Chris Stratton carried a shutout into the eighth before Arizona rallied.
''I think I can get the job done,'' Stratton said after his second straight quality start. ''We need guys to step up and get deep into ballgames and hand it over to our bullpen.''
Jarrod Dyson got the Diamondbacks on the board in the eighth with a run-scoring triple with none out. But Tony Watson came in and escaped the jam.
Arizona then tied it in the ninth on consecutive doubles for Paul Goldschmidt and Pollock off Strickland. Pollock advanced on a fly ball, but was stranded at third.
Longoria finished with three hits, including a double and a single. McCutchen had two hits.
Diamondbacks starter Robbie Ray allowed two runs and five hits in six innings. He struck out nine and walked three.
''I thought it was his best outing of the year,'' Diamondbacks manager Torey Lovullo said. ''He's getting outs and continuing to keep the game close. ... He did what he had to, kept his pitch count down enough and gave us six quality innings.''
Giants: RHP Jeff Samardzija (pectoral strain) will come off the disabled list and make his season debut Friday against the Los Angeles Angels, manager Bruce Bochy said. ... Longoria was back in the lineup after missing Tuesday's game with a sore left ankle.
Diamondbacks: RHP Taijuan Walker will have surgery for a partial elbow ligament tear, Lovullo said. ... 3B Jake Lamb (sprained shoulder) played four innings with five at-bats in an extended spring training game.
Lovullo said right-hander Matt Koch will be brought up from Triple-A Reno to start Friday's game and take Walker's place in the rotation, at least for one start. Koch was scratched from his scheduled start for Reno on Wednesday.
THE RAY WAY
Ray became the fastest left-handed starting pitcher in major league history to reach the 600-strikeout plateau in terms of innings pitched (510 1/3) when he fanned Stratton in the second inning.
The Giants made a pair of defensive gaffes in the outfield. Hunter Pence dropped a fly ball to left with two outs in the sixth, and Austin Jackson misjudged a Goldschmidt drive to center in the seventh that was a scored a double. Neither came back to hurt the Giants.
Giants left-hander Ty Blach (1-2) faces Arizona right-hander Zack Greinke (1-1) Thursday night in the series finale. Blach will be facing the Diamondbacks for the fifth time in his career, while Greinke is 3-1 with a 2.27 ERA in his last five starts against San Francisco.
Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.