Updated

Paul Goldschmidt sliced a game-winning solo home run over the right-field wall in the ninth inning to give the Arizona Diamondbacks a dramatic 5-4 victory over the New York Mets in the opener of a three-game series.

Goldschmidt's 27th home run of the season came on a hanging breaking ball from Scott Atchison (2-1) and gave the D'backs their seventh walk-off win and league-leading 23rd victory in their final at-bat.

"I just left a cutter up," Atchison said. "He's a good hitter...and he made me pay for a bad pitch."

Brad Ziegler (5-1) tossed a perfect ninth to pick up the win behind starter Patrick Corbin, who held the Mets to two runs on four hits and three walks over six quality innings but wound up with a no-decision.

Adam Eaton went 2-for-4 with a run scored and an RBI for Arizona, which has won three in a row for the first time since July 11-13.

Justin Turner went 2-for-4 with three RBI for the Mets, who couldn't build off a three-game sweep of the Colorado Rockies.

New York scratched two runs off Heath Bell in the eighth to tie the game at 4-4. Bell, who had not allowed a run in 11 straight appearances, gave up three consecutive singles to load the bases before Turner and Wilmer Flores each pushed a run across via groundouts.

The go-ahead run was stranded on third thanks to a nice defensive play by Martin Prado, and Goldschmidt sent the fans home happy an inning later.

"It was fun," Goldschmidt said. "You get an opportunity to win the game in the ninth inning or extra innings...and it's a lot of fun. Hopefully we can do it a few more times."

Six of Arizona's 10 hits went for doubles, including three consecutive two- baggers with two down in the fifth inning. Corbin started the string with a double to center field, and Eaton and Prado capped it with run-scoring extra- base hits to put the D'backs in front, 2-1.

Turner, who broke a scoreless tie with an RBI single in the fourth, added another one in the sixth to even things.

Again the D'backs answered as they began their half of the sixth with a single and a pair of doubles, with Wil Nieves' liner down the left-field line bringing in both Aaron Hill and Cody Ross.

Hill had a pair of big relay throws to secure the win, the second coming in the seventh when he gunned down Juan Lagares trying to leg out a triple. The first certainly saved a run, as his perfect toss to the plate denied Marlon Byrd from pulling off an inside-the-park home run in the second inning.

Game Notes

The D'backs lead the majors with 24 one-run victories ... Corbin, who has a 1.60 ERA in 13 home starts this season, tied Clayton Kershaw for the MLB lead with 20 quality starts and has allowed two runs or less in 18 of his 23 outings ... Mets starter Jeremy Hefner was touched for four runs on eight hits over five-plus innings.