PHOENIX (AP) Paul Goldschmidt seems to do it all for the Arizona Diamondbacks. It had been nearly two years since his last game-ending homer, though.
He had the big hit Monday night, connecting to lead off the ninth inning and lift the Diamondbacks over the Atlanta Braves 9-8.
He homered off John Gant (1-3), sending an 0-1 pitch deep into seats in left field and helping Arizona overcome a five-run deficit and a two-homer night from Freddie Freeman.
Arizona had its largest comeback win since June 3, 2015, when it bested the Braves after being down by six.
This was Goldschmidt's fourth career walkoff homer and sixth game-ending hit.
''The tendency in a tie game or extra innings is try to hit home runs. We have played some extra inning games and that has just not worked out for me and I'm sure for most guys,'' Goldschmidt said. ''It's nice not to have to take home a moral victory, get an actual one.''
Freeman hit a solo homer off Enrique Burgos (1-1) to tie it in the ninth.
Welington Castillo hit a two-out bases-loaded double during a four-run seventh that put Arizona ahead 8-7 after it trailed 5-0 in the second.
All four runs came off Arodys Vizcaino. Michael Bourn's single drove in Jean Segura to make it 7-5, then Goldschmidt singled and one out later, Yasmany Tomas walked. Castillo then lined a 2-0 pitch into the gap in left-center to clear the bases.
''I've said it all year, these guys have battled,'' Diamondbacks manager Chip Hale said. ''We have gone through some tough times. We have fallen behind. I have never thought they've given up. I always tip my hat to them.''
Tomas hit a two-run homer in the third, giving the slugger homers in four straight games at Chase Field. He's the fourth player in club history to do that.
Freeman and Adonis Garcia each hit two-run homers while the Braves scored the first five runs. Freeman, with three hits on the night, raised his career average to .400 at Chase Field with 50 hits, including 12 home runs.
''I love this place,'' Freeman said. ''I like it more than Colorado. I think it's the batters eye. You just get in that box and you just feel good. You see everything.''
Freeman returned to the lineup after missing Sunday's game with a finger injury. He also doubled and scored three times.
''Finger's good. Felt good. Didn't know what to expect, just seeing what was going to happen,'' he said. ''Decided to be aggressive on my first at-bat and got the first one (home run), and that calmed everything down after that.''
Nick Markakis had three hits and an RBI. Mike Foltynewicz pitched six innings and allowed four runs and nine hits, striking out seven.
Atlanta's big lead disappeared with Chris Owings' RBI single in the bottom of the second, Goldschmidt's sacrifice fly in the third and Tomas' home run, trimming the Braves' lead to 5-4. But Atlanta scored twice in the top of the fifth with Markakis' single and Chase d'Arnaud's sacrifice fly to take a three-run lead.
Arizona starter Zack Godley allowed seven runs in five innings. He allowed nine hits, walked three and struck out three.
Former Diamondback Ender Inciarte, the Braves' leadoff man Monday, received a round of applause and a few cheers upon being announced to start the game. Inciarte and former Arizona top prospect Dansby Swanson, traded to Atlanta for Shelby Miller in the offseason, were in Monday's lineup. Inciarte had two hits and scored twice.
Braves: IF-OF Jace Peterson was scratched from the lineup after crashing into a wall making a catch Sunday. He reported soreness after going shoulder-first into the center-field wall at Turner Field and was replaced by d'Arnaud at second base Monday. Peterson remained in Sunday's game and hit a game-ending homer in the 10th.
Diamondbacks: OF A.J. Pollock is expected to be activated from the disabled list later this week. He's yet to play this season while recovering from a broken right elbow.
Braves: RHP Rob Whalen (1-2, 5.73 ERA) is scheduled to pitch against Arizona. He's never faced the Diamondbacks in his career.
Diamondbacks: RHP Archie Bradley gets the call for Arizona. He's 4-8 with a 5.04 ERA and will be making his second career start against the Braves.