Amed Rosario pulled the Mets within a run on solo homer off Archie Bradley in the eighth inning. But Peralta, who homered off Jason Vargas (2-5) in the fourth inning, hit his 14th of the season off Jacob Rhame in the bottom half.
The Mets failed to score more than three runs for the 10th straight game and have lost 10 of 11.
Nimmo at least got the Mets trip to the desert started off right, hitting a solo homer in the first inning that barely cleared the wall in right. Conforto hit another solo shot off Koch in the sixth, pulling New York to 3-2.
That was about all they could manage against Koch, who allowed two runs before being replaced Yoshihisa Hirano to start the seventh.
Vargas has pitched better since a shaky start to the season, going 2-1 with a 2.50 ERA over his last four starts. He was moved up in the rotation to start against Arizona while Steven Matz deals with a blister on his throwing hand.
Vargas got through five innings against the Diamondbacks, giving up (Ketel) Martes RBI single in the second inning, Goldschmidts solo homer in the third and Peraltas leadoff homer in the fourth
Vargas allowed three runs on five hits with five strikeouts.
The Diamondbacks reinstated RHP Jorge De La Rosa (Achilles bursitis) from the 10-day disabled list and optioned RHP Silvino Bracho to Triple-A Reno. De La Rosa was 0-2 with a 3.54 ERA in 27 games before going on the DL.
Bracho was 2-0 with a 1.42 ERA in 11 games with Arizona.
Mets: 1B Wilmer Flores went 2 for 3 with an RBI for Single-A St. Lucie Wednesday night, his second rehab game since going on the 10-day DL with a sore lower back on May 28. … OF Jay Bruce was held out of the lineup after aggravating a hip injury Wednesday against Atlanta.
Diamondbacks: OF Steven Souza will continue throwing take live batting practice on Friday as he works his way back from a strained right pectoral muscle.
More AP baseball: https://apnews.com/tag/MLBbaseball