NEW YORK (AP) 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.

More from FoxSports

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.

Paul Goldschmidt went 2 for 4, driving in the first two Arizona runs, and Jean Segura and Chris Owings each had three hits. Segura added two stolen bases and Arizona stole four on the night. It has nine steals through the first two games in the series. New York came into the game with a minus-67 stolen base differential, the worst mark in the majors.

Neil Walker had two hits for the Mets, who have lost 14 of their past 19 games.

T.J. Rivera, from nearby Throgs Neck, made his major league debut at third base in front of about 30 friends and family members. He picked up his first big league hit in the tenth and handled all of his chances in the field.

TRAINER'S ROOM

Mets: INF Jose Reyes (oblique) will begin a rehab assignment with Class A Brooklyn on Thursday. His assignment had been delayed because the switch-hitter was still having trouble swinging from the right side, general manager Sandy Alderson said on Tuesday.

Diamondbacks: OF A.J. Pollock (fractured right elbow) went 3 for 3 with a home run and two RBIs for Class A Visalia on Tuesday. He was again in the lineup on Wednesday. ... OF Yasmany Tomas (stiff neck) remained out of the lineup after being a late scratch on Tuesday. He developed the injury after watching the Olympics in bed all day Tuesday.

UP NEXT:

Mets: RHP Noah Syndergaard (9-6, 2.64 ERA) looks to snap a career-worst five-start winless streak. The All-Star hurler struggled in his last start, allowing four runs in six innings in Detroit, but has pitched to a 5-3 record with a 2.41 ERA at Citi Field this season.

Diamondbacks: RHP Braden Shipley (1-1, 4.15 ERA) takes to the mound in the series finale for his fourth major league start. After struggling in his debut, he's thrown back-to-back quality starts, allowing two runs over his last 12 innings.

---

This story has been corrected to show that Arizona has nine steals in the first two games of the series.