SAN FRANCISCO — Pinch hitter Will Nieves delivered a sacrifice fly in the 10th inning to lift the Arizona Diamondbacks to a 3-2 victory over the San Francisco Giants on Wednesday.

Gerardo Parra and A.J. Pollock also drove in a run for the Diamondbacks, who beat the Giants in 11 innings on Tuesday night. Didi Gregorius had two hits.

Arizona led 2-1 before Brandon Crawford hit a tying homer off David Hernandez (1-0) with one out in the ninth. Crawford also doubled home a run in the seventh and finished with three hits.

Matt Reynolds got three outs for his second save in as many days. Reynolds has yet to allow a run in 11.1 innings.

Former Crescent City Baptist standout Chad Gaudin (0-1) got the loss as San Francisco dropped consecutive home games after winning seven in a row at its waterfront ballpark.

Diamondbacks ace Ian Kennedy and Giants left-hander Madison Bumgarner were locked up in a scoreless pitchers’ duel before Gregor Blanco singled and scored on Crawford’s hit in the seventh.

Blanco also had a leadoff single in the fifth for San Francisco’s first hit of the game.

Kennedy was charged with a run and four hits in six-plus innings. He struck out four and walked two.

The Diamondbacks responded in the eighth. Pinch hitter Eric Hinske was awarded a ground-rule double when Giants reliever Santiago Casilla, warming up in the bullpen, gloved his sharp liner down the third-base line. Parra then ran for Hinske and scored on Pollock’s single to center.

Parra added an RBI single in the ninth, but Crawford went deep in the bottom half.

Bumgarner struck out seven in 7.1 innings, yielding one run and five hits. He retired 18 of 19 batters before Hinske’s double.

Arizona’s Paul Goldschmidt singled in the first and has reached in all but one game. He was intentionally walked with a runner in scoring position in the eighth.

Rockies 6, Braves 5, 12 innings: In Denver, Wilin Rosario scored from second on Yorvit Torrealba’s single to left, and the Colorado Rockies rallied to beat Atlanta.

Michael Cuddyer and Josh Rutledge homered for the Rockies, who ended a three-game skid behind one-hit pitching by the bullpen over the last six innings. Matt Belisle (1-1), the fourth reliever used by Colorado, pitched two perfect innings.

Rosario led off the 12th with a double to left off Luis Ayala (1-1). After Cuddyer was intentionally walked, Belisle, who had to bat with no one else left on the bench, struck out on a bunt attempt.

Torrealba ripped a single to left, and Justin Upton’s throw home was wide as Rosario slid in with the winning run.

Cardinals 4, Nationals 2: In Washington, Yadier Molina hit a two-run single off Stephen Strasburg during St. Louis’ three-run first inning, and the Cardinals extended the Nationals’ ace losing streak to four starts.

Jaime Garcia (2-1) allowed a run on Bryce Harper’s sixth-inning ground out, but otherwise added to the offensive struggles of the Nationals, who have lost six consecutive home games and nine of their past 12 overall to fall to 10-11.

Washington scored only four runs in the three-game series.

Reds 1, Cubs 0: In Cincinnati, Mat Latos pitched four-hit ball into the eighth inning, and Todd Frazier hit a long home run for the Reds.

Frazier came up with one out in the sixth inning and drove a 1-0 pitch from Jeff Samardzija (1-4) deep to straightaway center field.

The ball bounced high off the batter’s eye while traveling an estimated 480 feet for the longest homer at Great American Ball Park this season and the seventh-longest in the 11-year history of the facility.

Latos (1-0) retired the first 10 batters and 15 of the first 16 he faced. He left with two runners on and none out in the eighth, but Jonathan Broxton wriggled out of the jam. Aroldis Chapman pitched the ninth for his fourth save.

Mets 7, Dodgers 3, 10 innings: In New York, Jordany Valdespin hit a grand slam in the 10th inning to cap the Mets’ rally.

David Wright tied it with a two-out single in the ninth off Los Angeles closer Brandon League, handed his first blown save in six chances.

Matt Kemp hit his first homer of the year and drove in three runs.

Pirates 5, Phillies 3: In Philadelphia, pinch hitter Brandon Inge hit a tiebreaking RBI single in the eighth inning for the Pirates.

Roy Halladay pitched six innings of one-hit ball and Chase Utley and Ryan Howard hit upper-deck solo homers off Wandy Rodriguez, but Mike Adams (1-2) couldn’t protect an eighth-inning lead.

Pedro Alvarez hit a solo homer off Antonio Bastardo in the seventh and his RBI single in the fourth was the only hit off Halladay.

Vin Mazzaro (1-0) retired the four batters he faced to earn the win. Mark Melancon worked the eighth and Jason Grilli finished for his ninth save in nine tries.