Arizona won the series opener on Monday when Adam Eaton hit the first pitch of the ninth inning into the pool in right field.
Goldschmidt matched him with his second game-ending homer of the homestand, lifting the first pitch by T.J. McFarland (1-1) just over the wall in right for his 29th homer and Arizona’s 25th win in its last at-bat.
Goldschmidt put himself in position for his third career walk-off homer, opening the ninth inning with a shot off closer Jim Johnson.
Heath Bell (3-1) worked a perfect 11th inning and Gerardo Parra hit his career high-tying eighth homer for Arizona.
Baltimore’s Chris Davis homered for the second straight game, a two-run shot that pushed his major league-leading total to 44. J.J. Hardy also homered for the Orioles, who have lost all five series they have had against Arizona.
NATIONALS 4, GIANTS 2
In Washington, Adam LaRoche hit a two-run home run in the sixth inning to help lift Washington over San Francisco.
The Nationals won their fourth in a row on a night when neither starting pitcher returned after a thunderstorm caused a rain delay.
Washington starter Gio Gonzalez threw four shutout innings. Giants ace Madison Bumgarner allowed just one run on an infield ground out in four innings.
LaRoche sent a 1-0 pitch from Guillermo Moscoso (1-1) off the facing of the second deck above the Nationals bullpen in right field. That came after a leadoff single by Ian Desmond and broke a 1-1 tie.
San Francisco scratched second baseman Marco Scutaro (stiff back) from the lineup. Joaquin Arias replaced him and had three singles and a double for a career-high four hits.
PADRES 7, ROCKIES 5
In Denver, Colorado, Nick Hundley homered and drove in two runs. Will Venable had three hits and San Diego rallied to beat Colorado.
Jedd Gyorko also went deep for the second straight night for the Padres, who rebounded from a 14-2 loss to the Rockies on Monday.
San Diego beat the Rockies for just the fourth time in 15 games this season.
Charlie Culberson had two hits and two RBIs, while Nolan Arenado and D.J. LeMahieu also had two hits each for Colorado, which had its four-game winning streak snapped.
The Padres got the win despite an uncharacteristic start from left-hander Eric Stults, who was 3-0 with a 3.35 ERA in six career starts against the Rockies.
The first four batters reached for Colorado, with Wilin Rosario delivering a two-run, bases-loaded single to center to make it 2-1. One out later, Todd Helton and Culberson had RBI singles to stretch the lead to 4-1.
The Padres jumped on Jeff Manship (0-2) in the second inning.
Huston Street got the final four outs for his 23rd save.
REDS 6, CUBS 4, 11 INNINGS
In Chicago, Choo Shin-soo hit a tiebreaking two-run single in the 11th inning and J.J. Hoover provided terrific relief work on his 26th birthday, helping Cincinnati beat the Chicago Cubs.
With no outs and the bases loaded, Choo jumped on the first pitch he got from Eduardo Sanchez (0-1) and lined it into the gap in right-center. Ryan Ludwick and Devin Mesoraco scored.
Nate Schierholtz, Dioner Navarro and Murphy homered for Chicago, who were shut out in each of their previous three home games. Schierholtz’s two-run drive in the second snapped a franchise record home scoreless stretch at 33 innings.
Hoover (3-5) allowed one hit in 2-1/3 innings, running his scoreless streak to 21 games and 24-2/3 innings. Aroldis Chapman finished for his 29th save in 33 chances, closing out Cincinnati’s sixth win in seven games.