New York rallied to tie it with two runs in the eighth, but the Mets' hopes of reaching extra innings ended when Goldschmidt hit a 1-1 pitch from Scott Atchison (2-1) over the wall in right. It was Goldschmidt's 27th homer of the year, easily a career high in his three major league seasons.
Brad Ziegler (5-1) struck out one while working a perfect top of the ninth to get the win.
Arizona won its third in a row and the Mets had a three-game winning streak snapped.
Benedict Cumberbatch's dramatic reading of R. Kelly lyrics is just what you need
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'