Goldschmidt's solo shot came with two away and brought Arizona its third straight win. The Dodgers have lost seven in a row.
The Diamondbacks survived a ninth-inning scare when closer Heath Bell gave up a leadoff double to Skip Shumaker. A.J. Ellis then grounded out, Andre Ethier struck out and Carl Crawford lifted a routine fly ball to left field that ended the game and gave Bell his third save.
Goldschmidt accounted for the other two Arizona runs with a home run in the sixth that rallied the Diamondbacks from a 2-0 deficit.
The win went to Wade Miley (3-1), who allowed two runs on seven hits in 7 2/3. Reliever Kenley Jansen was tagged with the loss after giving up Goldschmidt's eighth-inning blast.