SAN FRANCISCO (AP) -- Steven Souza Jr. homered leading off the third to end Arizona's 25-inning scoreless drought, then hit an RBI double the next inning and backed Zack Godley with a defensive gem that helped the Diamondbacks beat the San Francisco Giants 3-1 on Wednesday night.
Godley (14-7) struck out six over 7 2/3 innings of two-hit ball and increased his career best for wins as first-place Arizona moved a half-game ahead of idle Colorado in the NL West.
Arizona manager Torey Lovullo vowed to switch things up as needed to try to give his club a spark, going with Souza leading off in a move that proved spot on.
Lovullo said he will "do something a little outside the box" as necessary down the stretch, with everybody understanding each game is now so crucial in the playoff chase.
Before Souza's fourth home run of the year, the Diamondbacks hadn't scored since the third inning of Sunday's 5-2 win against the Mariners.
Souza also made a magnificent, diving, backhand catch on the warning track after the right fielder ran down pinch-hitter Gregor Blanco's deep fly to the gap in right-center. Souza tipped his cap after the play.
San Francisco had its four-game winning streak snapped, one victory shy of matching its longest of the season from May 30 to June 4. The Giants missed a chance to sweep the Diamondbacks in a series of three or more games for the first time since July 2016.
Godley, who is 6-0 over his last eight road starts, hit three Giants batters with pitches through five innings. The last time a Diamondbacks pitcher had three hit batsmen was Ian Kennedy on Aug. 9, 2010, against the Brewers.
Godley gave way to Archie Bradley after allowing a two-out single to Gorkys Hernandez and pinch-hitter Hunter Pence's walk. Bradley allowed Andrew McCutchen's RBI single but retired Joe Panik on a called third strike to end the inning.
Brad Boxberger got the final two outs on strikeouts for his 30th save.
Giants rookie Dereck Rodriguez (6-2) lost for the first time in 13 appearances -- 12 starts -- since June 9 at Washington. He walked a season-high four in five innings, allowing five hits with three strikeouts in his second start since coming off the disabled list from a strained right hamstring.
Arizona shortstop Nick Ahmed met with third base coach Tony Perezchica to discuss signals after a costly mistake a night earlier that Lovullo described as "maybe just a little gap in communication."
In a scoreless game, Ahmed was thrown out at home to end the eighth as he tried to come home from first on pinch-hitter David Peralta's single to deep right-center.
Ahmed saw Perezchica's initial, aggressive wave but then ran through a stop sign while charging for home.
"They're both claiming some responsibility," Lovullo said.
From now on with Ahmed, Perezchica will both give a stop sign and a verbal command.
Giants: Rookie CF Steven Duggar was placed on the disabled list with a potential season-ending left shoulder injury a day after a hard, headfirst slide back into second base. Duggar arrived at AT&T Park still very sore from the night before, when he wound up staying in the game and scoring the winning run in the bottom of the ninth for a 1-0 victory. ... Blanco was called up from Triple-A Sacramento. ... RHP Jeff Samardzija received a second opinion on his inflamed pitching shoulder from Dr. Tim McAdams at Stanford and it was advised the pitcher continue to rest the injury. There was no structural damage found but Samardzija's availability for the remainder of the season is in doubt based on the time he would need to build back up in his throwing program after the rest period. "Looking at the timetable here where we're at in the season, I think you have to be honest and say it's doubtful," manager Bruce Bochy said.
Left-hander Robbie Ray (3-2, 4.73 ERA) pitches for Arizona in its series opener at Dodger Stadium. Following an off day for the Giants, lefty Andrew Suarez (5-9, 4.42) takes the mound Friday at home to begin a weekend series with the New York Mets.