The Nationals lost star Bryce Harper in the first inning due to precautionary reasons after colliding with Marlins second baseman Derek Dietrich while running the bases. Harper's replacement, Matt den Dekker, hit a solo home run, his third of the season.
Anthony Rendon, Jayson Werth, Ian Desmond, and Wilson Ramos also drove in runs for the Nationals, who won the final game of the series after losing the first two.
Scherzer (12-11) allowed five hits and did not walk a batter to earn his first win since July 30 at Miami. He struck out six while throwing 74 of his 102 pitches for strikes. Scherzer lowered his ERA to 2.91.
It was the deepest Scherzer has been in a game without allowing a run since tossing a no-hitter on June 20 against Pittsburgh.
Felipe Rivero relieved Scherzer to pitch the ninth.
Harper reached base on a fielder's choice in the top of the first and was attempting to run to third on a ground ball hit by Jayson Werth to shortstop Miguel Rojas. Dietrich was going to second to cover the base when the two collided as Rojas' throw went to first base for the final out.
Marlins starter Brad Hand (4-6) allowed three runs, five hits, and four walks in 3 1-3 innings. Hand is 0-3 with a 13.97 ERA in his last three starts after pitching eight innings allowing two runs in a win against Pittsburgh on Aug. 25.
Hand issued a bases-loaded walk to Desmond for the Nationals' first run.
Rendon and Werth each had run-scoring singles in the fourth to push the lead to 3-0 before den Dekker's home run in the sixth.
The Nationals added a run in the ninth on a groundout by Ramos.
Marlins: RHP Jose Fernandez felt good the day after his first game since Aug. 7 tossing five shutout innings and striking out seven in a 2-0 win over Washington. "I feel good, no issues at all today," Fernandez said. "Everything is fine. Just ready to go."
Nationals: RHP Jordan Zimmermann (12-8, 3.32 ERA) takes the mound on Monday as Washington begins a three-game series at Philadelphia, which will counter with RHP Aaron Nola (6-2, 3.56).