PHOENIX -- If the Los Angeles Dodgers are to clinch the NL West title in Arizona, they've got only one more chance.
Goldschmidt's opposite-field two-run shot on a 3-2 pitch from Stephen Fife (4-4) in the first inning moved him into the NL lead with 34 home runs.
Yasiel Puig hit a solo home run calculated at 442 feet for the Dodgers, who have lost five of six and get one more chance to clinch in Arizona in the series finale Thursday.
The Diamondbacks want to send the Dodgers out of town with that celebratory champagne still on ice.
"It's still a pride thing," Arizona starter Brandon McCarthy said. "You understand where things stand but you don't want to see them celebrate. You knew coming into the season they were our competition, they're the ones who caught and passed us. ... If they go somewhere else, then whatever happens is fine. You just don't want them to do it on your home field and have to sit there know what's going on.
"If you can get them out of here without having to see it, then all the better."
It was a difficult night, Dodgers manager Don Mattingly said, but his team remains in a great position with 10 games to play.
"We like where we are at," he said. "It is one game at a time. Tonight was a little bit frustrating. it was a frustrating game, but other than that, I am not really frustrated so much."
No worries, Gonzalez said.
"We are fine," he said. "Win tomorrow. If not, we will win two in San Diego."
McCarthy (5-9) went six-plus innings to get the victory. He gave up two runs and scattered 10 hits.
Tim Federowicz drove in two runs with a home run and RBI double.
Arizona manager Kirk Gibson was glad that a national television audience got to see Goldschmidt -- who is the runaway NL RBI leader with 118 and is hitting .305 -- excel.
Gibson hopes the late exposure will help in the MVP voting.
"We were on ESPN tonight and I wanted Goldy to have a good game," Gibson said. "They're talking about other very good candidates. We're certainly biased here. He proves it day in, day out. He's everything you could want. He's certainly deserving of Most Valuable Player."
Arizona led 4-3 before blowing the game open with five runs in the eighth inning off Ronald Belisario, the sixth of seven pitchers used in the game by Los Angeles. Adam Eaton had a two-run single, Aaron Hill and Martin Prado each an RBI double and Chris Owings walked with the bases loaded.
Fife got the start in place of Clayton Kershaw, whose outing was pushed back three days to Saturday's game at San Diego to give him some extra late-season rest. Fife never made it out of the third, giving up a two-run homer to Goldschmidt in the first and a two more runs in the third as Arizona took a 4-0 lead. He allowed four runs on six hits in 2 1/3 innings, walking two and hitting two batters.
Gonzalez was tossed by second base umpire Andy Fletcher in the top of the sixth inning after Michael Young attempted to score from first on Gonzalez's double. Young was called out by first base umpire Jim Joyce, catcher Miguel Montero taking the shortstop Owings' relay throw and put down the tag although replays showed Young's hand appeared to touch the plate
Gonzalez said he was criticizing the call because he didn't think Joyce got into position to see the play.
"I got to second base and I could see clearly that he was safe," Gonzalez said. "I said, 'Let's go. If you guys are going to switch, hustle so you can make the call.' That is when he threw me out."
The Diamondbacks stranded 14 runners, leaving the bases loaded three times. ... Goldschmidt's 34 home runs tie him with Steve Finley for seventh on the Arizona career list. ... In the last meeting of the teams' this season, the Dodgers will send RHP Ricky Nolasco (13-10, 3.36 ERA) to the mound Monday while LHP Wade Miley (10-10, 3.70) will go for the Diamondback.. ... Gonzalez was ejected for the third time in his career, first this season.