WASHINGTON (AP) Washington starter Max Scherzer was solid Friday night except for a few mistakes.
These days, the Nationals have little margin for error.
Martin Prado and Marcell Ozuna homered off Scherzer, and the Miami Marlins built a three-run lead and held on to beat the Nationals 4-3.
The Nationals remain 6 1/2 games behind the NL-East leading Mets, who lost 6-4 to the Red Sox in ten innings.
Scherzer (11-11) went seven innings, allowing four runs and six hits. After surrendering Ozuna's homer to open the fourth, he retired the last 12 batters he faced.
''I'm not sitting here kicking chairs around because I'm frustrated at how I pitched,'' he said. ''My stuff's there. It's just that there's just a couple mistakes within my outing that I've got to shore up.''
Scherzer struck out eight without a walk.
After looking dominant earlier in the season, Scherzer has lost three straight starts for the first time since May 2010.
''I think he's strong, reaching back for 98 (miles an hour),'' manager Matt Williams said. ''I know that he feels good. Location may not as good as it was during that good streak that he had.''
Miami's Adam Conley (2-1), in his fifth major league start, gave up three runs and six hits over five-plus innings.
A.J. Ramos pitched around a leadoff single by Ian Desmond in the ninth for his 23rd save.
Desmond and Wilson Ramos homered for the Nationals.
Washington was without center fielder Denard Span, who was placed on the 15-day disabled list and will have left hip surgery on Tuesday.
Trailing 4-2, Washington loaded the bases against Conley with no outs in the sixth, but scored just one run.
Facing reliever Kyle Barraclough, Ryan Zimmerman hit a sacrifice fly to make it 4-3, but Desmond struck out. After Danny Espinosa walked to re-load the bases, Ramos hit a smash that deflected off Barraclough to second baseman Dee Gordon, who threw out Ramos.
''If that ball gets through, that's two (runs),'' Williams said. ''You can't do anything more than that. You can't steer it.''
Marlins manager Dan Jennings said of Barraclough. ''He's got ice water. You know we talk about A.J. all the time, but we've put this kid in some tough spots and he's responded very well.''
Miami went ahead in the first when Prado singled and scored on Derek Dietrich's double.
Desmond's 15th homer of the year tied it in the second.
Prado's two-run shot into the Nationals' bullpen made it 3-1 in the third, and Ozuna added his solo blast to center in the fourth.
Ramos pulled Washington within 4-2 in the fifth.
Marlins: LF Christian Yelich (right ankle, right knee) was out of the lineup for a second straight game. He's day-to-day. ... After allowing four runs in five-plus innings with Class A Jupiter on Thursday, RHP Jarred Cosart (inner ear) could make his next rehab start elsewhere amid concerns about Tropical Storm Erica's path, manager Dan Jennings said.
Nationals: 3B Yunel Escobar (right hand contusion) was out of the lineup after getting hit with a pitch Thursday and is day-to-day. ... OF Michael Taylor (right knee contusion), was not in the lineup after crashing into the wall while trying to make a catch Thursday, but was available off the bench.
Miami RHP Tom Koehler (8-12, 3.98) is looking for his first win since July 23. He is 3-5 with a 4.28 ERA in eight career starts against Washington. Nationals RHP Jordan Zimmermann (10-8, 3.54) has won his last two starts despite allowing eight earned runs and 17 hits over 11 2/3 innings.
Washington's Trea Turner made his first Major League start. He went 0 for 3 while playing second base, but made several sharp defensive plays, including a nice running catch of Ozuna's foul fly in the sixth. ''I can't wait for his first hit. I want to watch him run,'' Desmond said. ''He's a fast little whippersnapper.''
''I kind of looked in my glove at first and didn't know where it was and kind of panicked. And saw Dee had it, and was, `OK, Good.' Sometimes you've got to get lucky,'' Barraclough said regarding the Ramos smash that ended the Washington sixth.