MIAMI (AP) For the second time in three days, Martin Prado put a dent in the Mets' division lead.
Prado hit a sacrifice fly in the bottom of the ninth inning to give the Miami Marlins a 4-3 victory Sunday.
New York's lead in the NL East was shaved to four games over the Nationals heading into a pivotal three-game series between the teams beginning Monday afternoon in Washington.
''Certainly it's tightening up,'' Mets manager Terry Collins said.
The Nationals beat Atlanta 8-4 on Sunday to finish a four-game sweep. Meanwhile, the Mets dropped two of three in Miami - with both losses coming on game-ending swings by Prado. He also hit a walk-off double in Friday's 6-5 win in 11 innings as part of a five-hit night.
''My heart was going like a race car, but you just have to stay focused,'' Prado said Sunday. ''It's all about momentum. I feel good about my swing and I was in a good spot, and when things are going like that you feel like you have a pretty good chance to win.''
Pinch-hitter Justin Bour delivered a tying homer for the Marlins with two outs in the eighth off Tyler Clippard (2-1).
Jeff Mathis struck out leading off the ninth but advanced to first base on a wild pitch by Clippard. Dee Gordon singled and Christian Yelich was intentionally walked to load the bases with one out.
''You want to get a double play,'' Collins said. ''Yelich can run and is a lot faster than Prado. I just said, if this guy can hit a groundball we're going to get a double play, where I don't think that's the same feeling with Yelich.''
Prado, who is 2 for 22 against Clippard, saw 12 pitches from the reliever, fouling off six straight before hitting a line drive to left field. Yoenis Cespedes made a leaping catch, but his throw home was too late to get pinch-runner J.T. Realmuto.
''We've faced each other a lot in the past and he's got a good idea of what I'm bringing to the table,'' Clippard said. ''He did a good job battling a lot of tough pitches off and he got one out there in the outfield deep enough.''
Marlins manager Dan Jennings said he felt very good with Prado at the plate in a big situation.
''He's given those types of quality at-bats pretty much all year and of late he's really been on fire,'' Jennings said.
A.J. Ramos (2-4) escaped a bases-loaded jam in the top of the ninth when pinch-hitter Travis d'Arnaud grounded into a double play.
''I got my pitch,'' d'Arnaud said. ''I just pulled my head off a little bit and rolled it over.''
Bour's home run landed in the upper deck in right field. It was the Marlins' first pinch-hit homer of the season and Bour's first career pinch-hit homer.
''I tried to give him a day off and he came in and kept us in it,'' Jennings said.
Cespedes and Wilmer Flores homered for the Mets, who are 4-5 after a seven-game winning streak.
''We lost a couple tough ones here, but there's no reason for it to affect us moving forward,'' captain David Wright said. ''It's going to be a big series. It's two really good teams going at it.''
New York rookie Steven Matz tossed 5 1-3 innings, allowing two runs and four hits in his first major league start since July 5 at the Los Angeles Dodgers.
The left-hander exited with a blister on the middle finger of his pitching hand, but is optimistic he'll be able to make his next start.
''I think we caught it before it got too bad,'' Matz said. ''I used to get it a lot in 2013 when I pitched in Savannah and it was really humid. I guess your skin just softens up when it gets humid.''
Matz struck out six and walked two while throwing 51 of 81 pitches for strikes. He was 2-0 with a 1.32 ERA in two career starts before a partially torn muscle near his armpit sidelined him for almost two months.
Cespedes' solo home run in the first inning was his 12th with the Mets in 33 games since they acquired him in a July 31 trade with Detroit. He has a career-best 30 overall this season.
The Marlins tied it in the bottom half on a single by Marcell Ozuna. Mathis gave them a 2-1 lead in the fifth with his first home run since May 14, 2014, at Dodger Stadium.
Cespedes led off the sixth with a single against Chris Narveson. Flores homered two batters later to put the Mets ahead 3-2.
Jarred Cosart also made his return to the mound for the Marlins in his first start since July 4 at the Chicago Cubs due to a bout with vertigo. Cosart pitched 4 2-3 innings, allowing one run and five hits.
Mets: LF Michael Cuddyer (right wrist tendinitis) received a shot, and the expected recuperation time is 24-48 hours. He was unavailable to play and is questionable for Monday. ... 1B Lucas Duda (lower back) went 1 for 3 with a single and a walk in a rehab game for Double-A Binghamton against Altoona. He played nine innings at first base.
Marlins: RF Giancarlo Stanton (left hand) still hopes to return to the lineup this season, although there is a possibility he won't make it back. Stanton exited early in his first rehab game with Class A Jupiter on Tuesday after three plate appearances citing issues with his hand, but has resumed the rehab process in Miami.
Mets: LHP Jonathon Niese (8-10, 4.17 ERA) faces Nationals ace Max Scherzer (11-11, 2.89) on Monday. The clubs meet again in the final series of the season at Citi Field.
Marlins: LHP Justin Nicolino (3-2, 3.07) takes the mound Monday afternoon against Milwaukee RHP Zach Davies (0-0, 8.31).