Nimmo went 3-for-5 and finished a double short of hitting for the cycle. He hit the first of three solo homers for New York, which had four home runs on Monday. The Mets have scored 19 runs in their last two games.
''We're just trying to make positive strides,'' Nimmo said. ''We are moving in the right direction.''
Nimmo has been an on-base machine for the Mets, entering with a National League-best 22 walks and a .913 OPS.
''He's a guy that has a lot of trust in the strike zone and what he believes is a pitch he's looking for,'' Mets manager Luis Rojas said. ''He had a great approach again tonight. He's been getting on base the whole season for us. It shows how aggressive he can be with his approach at the plate.''
The Marlins (9-8) lost their fourth straight and for the seventh time in nine games since their 7-1 start.
J.D. Davis and Amed Rosario also homered for the Mets (11-14), who broke the game open with four runs in the eighth inning.
Rosario, whom Rojas has stuck with as his starting shortstop despite his early-season hitting struggles, posted three RBI and went 2-for-5.
''It's been difficult because the results haven't come, but I continue to work and keep a positive attitude,'' Rosario said. ''I'm an aggressive hitter. What I've been trying to do the last few days is shrink my strike zone and focus on the pitches I can do damage on.''
The Mets lost another starting pitcher to injury Tuesday when they placed David Peterson on the 10-day injured list with left shoulder fatigue.
Corey Oswalt started in his place and gave up two runs on five hits with four strikeouts and no walks in 4 1/3 innings. Mets' relievers Justin Wilson (1-1), Jared Hughes and Dellin Betances combined for 3 2/3 scoreless innings before the Marlins scored a run on three hits off Edwin Diaz in the ninth.
Marlins rookie Humberto Mejia (0-1) made his second career start (both against the Mets) after being recalled Tuesday, and gave up three runs on four hits, including the homers by Nimmo and Davis.
Mejia, who had never pitched above Double-A before his big league debut, is one of nine different starting pitchers the Marlins have used this season since losing three starters due to COVID-19.
''We know we're asking a lot, and you still get disappointed when you're hoping for the best in that scenario, but you have to be realistic at the end of the day,'' Marlins manager Don Mattingly said. ''He is showing us that he can be a quality major league pitcher. It's a huge leap.''
Miami switch-pitcher Pat Venditte exited the game in the top of the sixth with a right oblique strain and was listed as day-to-day.
RHP Sandy Alcantara said he plans to throw about 50 pitches against hitters on Wednesday at the team's alternate training site. Alcantara would be lined up for a possible return to the rotation as early as Monday at Washington.
Mattingly said INF Miguel Rojas may be the closest among the Marlins' position players on the injured list to returning. Mattingly indicated that many of the position players will get around 25-30 at-bats in Jupiter before being activated.
The Marlins placed LHP Brian Moran on the 10-day injured list (retro to Monday) with right knee patella tendonitis. RHP Mike Morin (right elbow) was also transferred to the 60-day injured list.
The Mets recalled RHP Drew Smith and optioned RHP Franklyn Kilome. The Marlins optioned INF Lewin Diaz and RHPs Jordan Yamamoto and Justin Shafer and selected the contracts of LHP Brandon Leibrandt and RHP Brett Eibner. OF Corey Dickerson was reinstated from the bereavement list.
Mets: RHP Jacob deGrom (2-0, 2.45 ERA) is scheduled to start Wednesday. deGrom was scratched from his last scheduled start because of a stiff neck and has not pitched since Aug. 9.
Marlins: RHP Pablo Lopez (2-1, 2.25 ERA) will make the start for Miami. He allowed two runs in six innings against the Braves last Friday.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Copyright 2020 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.