Flushing, NY (SportsNetwork.com) - Travis d'Arnaud's two-run double in the bottom of the eighth was the difference, as the Mets took down Texas, 6-5, in the marathon opener of a three-game interleague series.
Lucas Duda hit a two-run homer, while Eric Campbell went 3-for-3 with an RBI and run scored for the Mets, who snapped a four-game slide.
Jon Niese left after retiring only one batter with a lower-back contusion. Four relievers combined to keep the hosts in the contest, with Jenrry Mejia (5-3) recording the final four outs for the win.
"It's big for us," said d'Arnaud. "Especially to start the homestand."
Elvis Andrus collected three hits and scored once, while Shin-Soo Choo and Adrian Beltre homered for the Rangers, losers in six straight. Alex Rios and Adam Rosales each drove in a run in defeat.
Aaron Poreda (2-1) was charged with the deciding run.
In a 4-4 game, Poreda walked Bobby Abreu to start the frame, then after fanning Duda, gave way to Jason Frasor, who allowed Campbell's single to center ahead of d'Arnaud's drive to center which plated both and gave the hosts a two-run edge.
"The changeup hadn't been there," said Frasor. "My offspeed pitch hadn't been there."
Mejia retired Rios on a grounder to end the top of the eighth, but ran into trouble in the ninth by walking pinch-hitter Leonys Martin with one down. Martin moved up on a passed ball then came in on Rosales' base hit to left.
Robinson Chirinos was the final out of the contest, but even that was an adventure, as his pop to short was blown by the wind until Daniel Murphy was able to close his glove on it.
Game time was 4 hours, 8 minutes, one of the longest 9-inning contests in Mets history.
Niese gave up a game-commencing home run to Choo and a single to Andrus, then appeared to be in discomfort after being hit with a Rios grounder in the back. He was removed, to his visible frustration, after 12 pitches. Carlos Torres took over, and kept Andrus from scoring by grounding out Beltre and Chris Gimenez.
The Mets dented Texas starter Yu Darvish thrice in the opening frame. Curtis Granderson doubled with one down and scored on Abreu's two-out single, then Duda's high arcing drive to left was carried by the wind and hit the railing just above the top of the wall for a two-run homer.
Rios singled home Choo in the third, but the Mets again led by two in the fourth after Duda worked a leadoff walk and scored when Campbell followed with a double.
The Rangers tied the game with single runs in the fifth and seventh, as Beltre's blast in the former closed the gap to one and a Gimenez groundout scored Andrus in the latter.
The Mets improved to 29-34 all-time on Independence Day ... Despite his early exit, Niese extended his streak to 21 consecutive starts allowing three earned runs or less, the longest current streak in the majors ... It is also the third-longest streak in team history and longest since Johan Santana went 21 straight starts from July 22, 2009-May 11, 2010 ... Darvish's fourth-inning double was the first extra base hit by a Rangers pitcher since Colby Lewis doubled on June 29, 2011 ... Prior to the contest, the Rangers promoted Neftali Feliz from Triple-A Round Rock while optioning reliever Ben Rowen to the Express.