PHOENIX (AP) -- Another big hit in a breakout season for Paul Goldschmidt.
The Arizona slugger homered to the opposite field with one out in the ninth inning to give the Diamondbacks a 5-4 victory over the New York Mets Friday night.
Goldschmidt's 27th homer, his second game-winner of the year, came on a 1-1 pitch from Scott Atchison (2-1) after the Mets had rallied from a two-run deficit.
''He got ahead with his slider and missed with a curveball,'' Goldschmidt said. ''He threw another slider. Luckily it was up and I was able to hit it out of there.''
Atchison said it was just a bad pitch.
''I threw him a good one on the first pitch he took and tried to duplicate that again,'' he said. ''Rushed it, whatever, it just wasn't a good pitch and he is a good hitter.''
Brad Ziegler (5-1) pitched an inning of scoreless relief for the win.
The Mets' Marlon Byrd was thrown out at the plate trying for an inside-the-park home run in the second inning.
Patrick Corbin, looking for his 13th win, left with a 4-2 lead after six but the Mets scored twice off Heath Bell in the eighth to tie it, ending the reliever's string of 11 straight scoreless outings.
Atchison, the Mets' sixth pitcher of the night, retired Martin Prado to start the ninth. But Goldschmidt took him deep to right field, clearing the fence as Arizona improved to 3-0 to start an eight-game homestand.
Goldschmidt didn't have a game-winning hit until this season. Now he has three, two of them home runs. The homer boosted his NL-leading RBI total to 91. He was doused with water as he approached home plate to be mobbed by his teammates.
''Oh, it's fun,'' he said. ''It doesn't matter if it's you hitting it or a teammate hitting it, you get an opportunity to win the game there in the ninth inning or extra innings or whatever it is, it's a lot of fun. Hopefully we can do it a few more times.''
The Mets' Justin Turner had three RBIs on two singles and a groundout, giving him 10 RBIs for the season.
Consecutive two-out doubles by Corbin, Adam Eaton and Prado put Arizona up 2-1 in the fifth. New York tied it in the sixth, but in the bottom half of the inning, Wil Nieves' double brought in two runs to give the Diamondbacks a 4-2 lead.
Corbin, 0-2 in his last three starts, allowed two runs and four hits in six innings, walking two and hitting two batters. He also had a wild pitch that led to a New York run.
''You saw him miss up and away a lot,'' Arizona manager Kirk Gibson said. ''His changeup was the same. He didn't have a good slider like he has in the past but he battled. We got though six. It's a shame he didn't get the win. ''
Leading off the second, Byrd hit one deep to right center, where the ball careened off the porch that extends a few feet over the field. The ball bounced all the way back to left center.
When left fielder Prado finally chased it down, Byrd was motoring around third. Prado fired to Aaron Hill, whose perfect relay home was just in time for the catcher Nieves to tag Byrd despite the Mets' slugger's head-first slide.
It would have been Byrd's first career inside-the-park homer.
Hill also threw out Juan Legares trying to stretch a double to a triple with a relay throw from right fielder Cody Ross to end the seventh.
Arizona broke a 2-2 tie in the sixth after Hill singled and Ross doubled to put runners at second and third with no outs. Nieves doubled down the left-field line to bring both runners home, giving the Diamondbacks a 4-2 lead just as Corbin left the game.
In the eighth, Bell gave up singles to Daniel Murphy, Byrd and Josh Satin to load the bases with no outs. Groundouts by Turner and Wilmer Flores each brought home a run to tie it at 4 before John Buck bounced out to strand Satin at third.
Notes: Byrd needs one home run to reach 100 for his career. ... On Saturday night, RHP Brandon McCarthy (2-5, 4.94 ERA) makes his first home start since returning from the disabled list while RHP Zack Wheeler (4-2, 3.73) goes for New York. ... The Mets, coming off a three-game home sweep of Colorado, opened an 11-game, four-city trip that concludes with a makeup game at Minnesota.