Oscar Hernandez #28 of the Arizona Diamondbacks is hugged by assistant hitting coach Mark Grace #17 and congratulated by pitching coach Mike Butcher #23 ( Rich Schultz/Getty Images)

NEW YORK — Oscar Hernandez hit his first major league homer in the 12th inning, leading the Arizona Diamondbacks over the New York Mets 3-2 on Wednesday night.

Hernandez was recalled from Double-A Mobile after Arizona placed catcher Welington Castillo on the paternity list Tuesday. Playing his first game this season, Hernandez drove a sinker from Jerry Blevins (4-2) down the left-field line. He played 18 games with Arizona in 2015 as a winter meeting draft pick from Tampa Bay.

Randall Delgado (3-1) pitched two perfect innings with two strikeouts to win.

The Mets' Kelly Johnson forced extra innings with a two-run blast in the ninth off closer Jake Barrett. The blown save was Barrett's fourth in eight chances.

Arizona starter Robbie Ray pitched seven shutout innings, scattering three hits and striking out four. Ray was perfect until Ty Kelly's fourth-inning single.

New York remained 2 1/2 games back of the Marlins for the second NL wild card.

Sign up for the NJ1015.com Newsletter

Get the best of NJ1015.com delivered to your inbox every day.

(Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed)