MIAMI (AP) Martin Prado hit a sacrifice fly in the bottom of the ninth inning to give the Miami Marlins a 4-3 victory over the New York Mets on 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.

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.

More from FoxSports

He also hit a walk-off double in Friday's 6-5 win in 11 innings as part of a five-hit night.

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.

Prado saw 12 pitches from Clippard, 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.

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.

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.

Cespedes and Wilmer Flores homered for the Mets.

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.

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.

TRAINER'S ROOM

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.

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.

UP NEXT

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 to begin a three-game series against Milwaukee, which will counter with RHP Zach Davies (0-0, 8.31).