NEW YORK — Needing to play catch-up yet again, the New York Mets got their biggest swings from backstops Tomás Nido and Wilson Ramos in another dramatic win.

Nido homered against Buck Farmer leading off the 13th inning, Ramos went deep twice and the Mets beat the Detroit Tigers 5-4 on Saturday for another comeback victory during this wild homestand.

Nido — Ramos' backup who entered as a pinch-hitter in the 11th — drove a 2-0 pitch from Farmer (3-4) just beyond leaping centre fielder JaCoby Jones at the wall in right-centre, ending a game full of wasted chances for both teams. Nido was doused with water at home plate, and Noah Syndergaard dumped a jumbo bag of popcorn over his head during an on-field postgame interview following the 25-year-old's third career homer.

It was Nido's first walk-off hit since high school.

"That was an unbelievable feeling," he said.

New York has won five of six at Citi Field this week despite trailing in all but one of those games. That came after the front office spoke up Monday to defend embattled second-year manager Mickey Callaway. The Mets (25-26) can climb back to .500 with a win Sunday.

Ramos drove in four and had New York's only three hits through eight innings, including a go-ahead, two-run shot in the sixth. He has three homers in two days, bringing his total to five for the season.

"I've been working really good in the cage right now," he said. "I'm getting my timing back."

It's only the second time in franchise history two catchers homered in the same game, following Gary Carter and Ed Hearn in 1986.

"It was like Mike Piazza back there or something," Callaway said.

Ramos also picked off Gordon Beckham at first base in the 11th. Ramos walked with one out in the bottom of the inning and was pinch-run for by pitcher Steven Matz.

All-Star closer Edwin Díaz entered with New York leading 4-3 in the eighth seeking his first four-out save of the season — his first stab at one since Callaway changed his tune on using Díaz for more than three outs days earlier. Díaz replaced Robert Gsellman with a runner on third and quickly allowed a tying single to Jones for his first blown save as a Met. Díaz had converted 22 straight save chances dating to last season, including 12 this year.

Wilmer Font replaced Díaz to start the ninth and pitched through the 10th, freezing Jones with a 3-2 curveball to strand two runners.

Detroit left-hander Daniel Stumpf pitched out of a one-out, bases-loaded situation in the 11th, and New York's Héctor Santiago (1-0) escaped an identical jam in the 12th with a strikeout and a flyout.

Detroit was 1 for 13 with runners in scoring position and stranded 14.

"We had our opportunities," manager Ron Gardenhire said.

Gardenhire used 20 players for the second time in his 13-season managerial career. He also used 20 while leading Minnesota over Milwaukee 6-5 in 14 innings on May 28, 2013.

"We don't get involved in stuff like this too often," Gardenhire said.

Dawel Lugo had a career-high four hits for Detroit, which has dropped 10 of 11 after ending a nine-game skid Friday.

Brandon Dixon put the Tigers ahead 3-2 in the sixth with his first career pinch-hit homer, a two-run shot against Tyler Bashlor.

Tigers left-hander Ryan Carpenter threw five efficient innings, allowing two runs and two hits over 56 pitches in his third career start, but he left trailing thanks in part to consecutive balk calls against him in the fourth. The balks advanced J.D. Davis from first to third after he reached on Lugo's error at third, and Davis then scored on Ramos' single.

Carpenter was initially confused by what triggered the infractions, and Gardenhire argued with crew chief Jerry Meals and second base umpire Ron Kulpa before having words with Carpenter. The issue was that Carpenter was coming to the set position twice.

"I had to explain to him, you just have to fix it right now or they're going to keep calling balks," Gardenhire said. "He didn't really understand it at first, but then he got it and did fine."

Gardenhire said Carpenter will remain in the rotation, with Gregory Soto going to Triple-A Toledo to make his next start.

Mets starter Jason Vargas navigated trouble effectively throughout his return from the injured list with a strained left hamstring. He had a runner on base in each of his five innings but limited Detroit to a run and five hits.

TRAINER'S ROOM

Tigers: INF Jordy Mercer was set to begin an injury rehab assignment with Toledo. Mercer has been out since May 9 with a right quad strain.

Mets: OF Michael Conforto again participated in baseball activities, and New York hopes he'll clear Major League Baseball's concussion protocol to return Sunday. ... INF Luis Guillorme was sent to Triple-A Syracuse to make room for Vargas, leaving New York with just 12 position players.

UP NEXT

Detroit starts another rookie, RHP Spencer Turnbull (2-3, 2.68), against New York RHP Zack Wheeler (3-3, 4.74). Turnbull entered Saturday third among qualified rookie starters in ERA and strikeouts (54).

___

Follow Jake Seiner: https://twitter.com/Jake_Seiner

___

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports