"No doubt this was an emotional trip for us, losing G, and all that we were going through," Miami manager Mike Redmond said. "To come in there and keep battling and get a big win and win the series here, that's huge."
With the victory, the Marlins moved two games ahead of the Mets for third place in the National League East. New York won the season series, 8-11.
Until they are mathematically eliminated from the NL Wild Card race, the Marlins will keep playing as if they are in it.
"It's good to finish off this long road trip on a high note and get a road series here," Yelich said. "It's no secret to anybody in here where we stand. We're going to keep playing as hard as we can until they tell us we're out of it. But we're not out of it until we're out of it. That's kind of been our mindset all year: Never give up and keep fighting."
After slapping out 13 hits, and scoring just one run in Tuesday's 9-1 loss, the Marlins' offense got off to a more productive start on Wednesday. Mets starter Dillon Gee gave up four runs on seven hits in 6 2/3 innings.
In the first inning, Miami scored two runs on four hits off Gee. Donovan Solano flared a single to right, starting a string of four consecutive hits. Casey McGehee singled up the middle, and Marcell Ozuna's single to left loaded the bases.
With Garrett Jones at the plate, Gee was charged with a wild pitch on a pitch that actually redirected off the tip of Jones' left shoe. Solano scored, and Mets manager Terry Collins asked if it should have been a hit by pitch. Jones never flinched, and the wild pitch stood.
Jones topped an infield RBI single to third, and Miami had a two-run advantage.
"I have not ever seen Dillon Gee miss around the strike zone -- the ball is up and in, up and in, up and in to right-handed hitters," Collins said.
In the second inning, Solano's RBI single scored Yelich, who walked and stole second, putting Miami ahead, 3-0.
Miami's defense also came up big with Ozuna in center, Jones at first and Adeiny Hechavarria making big plays.
The Mets used a two-out, two-run single by Lucas Duda in the fifth inning to close the gap to 3-2. Alvarez put himself in a bind when he allowed a one-out single to Gee, who had been 0-for-35 on the season, and 0-for-41 dating back to last year. A two-out walk to Travis d'Arnaud loaded the bases for Duda, who singled crisply to center.
New York had a chance for more, but with two outs, Wilmer Flores, who had two homers and drove in six runs on Tuesday, lifted a long fly ball to left-center. Ozuna raced over from his center-field spot and made a leaping catch at the wall, likely saving two runs.
"I left some pitches up in the zone today," Alvarez said. "I have a great defense, and they were able to back me up today. I was grateful for the play that Ozuna made. It helped me get out of that inning."
Yelich's RBI double off lefty Josh Edgin with two outs in the seventh inning padded Miami's lead to two runs, and it became the difference.
Without Stanton's power in the middle of the order, the team is scratching for runs. The team also has dealt with the letdown of losing a popular player to a horrific injury.
"It hasn't been easy the last few days, but it is part of it," Yelich said. "You've got to deal with that kind of stuff throughout the year. That's why this game is so tough. It comes at you every day. You've got to be able to deal with it."