MIAMI — Danny Espinosa’s three-run homer run accounted for the Washington Nationals’ only runs of the game.

It was not enough, though, as Washington fell 4-3 to the Miami Marlins on Monday night.

“We made a couple mistakes during the game,” Nationals manager Dusty Baker said. “We had opportunities to win the game and take the lead and we didn’t get it done.”

Washington trailed by a run to begin the ninth when Wilson Ramos led off with a double to left-center field. Michael Taylor pinch-ran for Ramos and was thrown out at third on a groundball to shortstop Miguel Rojas.

“I can’t speak for what a guy was thinking, but that was a mistake,” Baker said.

Pinch-hitters Bryce Harper and Daniel Murphy flied out to end the game leaving a runner stranded at first in the Nationals’ third consecutive loss.

The Nationals trailed by a run in the seventh and had two on and no outs. Fernando Rodney was able to get out of the jam without allowing a run to score.

Wei-Yin Chen was sharp through his four innings in his first game for the Marlins since July 20. Espinosa’s homer ended his outing.

“Obviously, a good one for us being on life support,” Marlins manager Don Mattingly said in reference to the team’s slim playoff chances. “A lot of good things happened. Wei-Yin was really good, the air came out of the balloon quick in the fifth.”

Miami trails San Francisco and St. Louis for the second wild card spot with 12 games left.

Giancarlo Stanton hit his 26th home run and Christian Yelich, Ichiro Suzuki and Derek Dietrich drove in runs for the Marlins.

Brian Ellington (3-2) picked up the win with an inning of relief and A.J. Ramos pitched the ninth for his 38th save in 41 chances.

A.J. Cole allowed two runs and four hits in four innings for the Nationals. He struck out three and walked two.

“I didn’t have my best stuff, but I fought to keep my team in the game and I went out there and still tried to throw my stuff where I wanted to and battle through it,” Cole said.

Mat Latos (7-3) took the loss, allowing two runs in 1 1-3 innings.

Chen made his first start in two months due to an elbow strain, and allowed three runs and four hits, ending his night after 4 1/3 innings.

The Marlins took an early 2-0 lead on Stanton’s solo home run and an RBI double by Yelich.

Espinosa’s homer put the Nationals on top 3-2.

“I was trying to get something out over the plate so I could get it to the outfield and ensure one run — a fly ball or something like that,” Espinosa said. “He threw me a couple good changeups and I just tried to settle down and wait for a pitch that I could get at least one run in.”

Miami responded with two runs in the sixth to take a 4-3 lead behind an RBI double by pinch-hitter Dietrich and a fielder’s choice by Suzuki that allowed Justin Bour to score as second baseman Wilmer Difo’s throw was wide to home plate.

“These guys could have quit after the three-run homer but we put up good at-bats and kept going hard and we prevailed,” Marlins second baseman Dee Gordon said.

BOUR’S BUNT

Bour dropped down a successful bunt to the open left side of the infield in the pivotal sixth inning with the Nationals in a shift for the left-handed hitter and he later scored the eventual game-winning run.

It was Bour’s first bunt for a hit this season and he does not have a sacrifice bunt in 247 career games.

“I saw a situation and at this point every game is huge for us,” Bour said. “Whatever it takes to get the job done and I had an opportunity to bunt.”

TRAINER’S ROOM

Nationals: RHP Stephen Strasburg (elbow) played catch on Monday for the first time since leaving his Sept. 7 start early. … C Jose Lobaton (ankle) has not played since Sept. 13 when he was a defensive replacement.

Marlins: LHP Adam Conley (finger) is going to throw a simulated game on Wednesday and could re-join the team in some capacity before the end of the season. “He’s feeling really good,” Mattingly said. “He came into my office and told me he feels totally healthy.”

UP NEXT

Nationals: RHP Tanner Roark (15-8, 2.75) will start the second game of the series with the Marlins. Roark is 2-1 with a 1.08 ERA over his last four starts.

Marlins: RHP Jose Fernandez (15-8, 2.99) enters Tuesday’s start with 174 1/3 innings on the season with the goal of keeping him in the 180-inning range.