Miami, fourth in the NL East, is 26-39 against teams other the last-place Nationals.
Jon Berti stole two bases to increase his major-league leading total to 24.
Keibert Ruiz homered for Washington, which fell to 6-25 against the NL East and 29-50 overall. It lost its 50th game by the earliest date since the 2009 Nats were 22-50 after games of June 26.
Trevor Rogers (4-6) allowed one run and two hits in five innings. Rogers is 3-0 with a 2.25 ERA in three starts against the Nationals this season and 1-6 with a 6.58 ERA in 12 outings against other teams.
“I was getting ground balls right at guys,” Rogers said. “Even when they made solid contact, they were right at guys.”
Tanner Scott worked a perfect ninth for his eighth save in nine chances.
Washington starter Josiah Gray (6-5) retired Miami’s first six hitters before yielding Anderson’s solo shot to lead off the third. The Marlins pushed across two more runs with two outs in the inning when Joey Wendle hit an RBI single and scored on Garrett Cooper’s double.
Anderson’s homer was his first since May 14. He returned from the injured list Monday after missing 28 games with a lower back injury.
“After getting to see the other guys do it, I was starting to get a little jealous,” Anderson said of wearing the Marlins’ celebratory home run helmet. “That was a cool way to get us going today and I’m looking forward to wearing it a couple more times.”
Berti added a sacrifice fly in the fifth to make it 4-1, and Miami tacked on Anderson’s run-scoring single and Berti’s RBI fielder’s choice in the sixth against Gray, who allowed six runs and 10 hits in 5 2/3 innings.
“Nine batters he was ahead, he punched out six,” manager Dave Martinez said. “Seven batters he fell behind, five guys got on base. When he works ahead, he’s really good and we’ve seen that in the past. We have to get him to continue to work ahead and throw strikes.”
Miami selected the contract of OF Billy Hamilton from Triple-A Jacksonville and designated INF Erik Gonzalez for assignment. Gonzalez hit .189 with three RBI in 37 at-bats.
Washington recalled C Tres Barrera from Triple-A Rochester, optioned C Riley Adams to Rochester and designated LHP Sam Clay for assignment. Adams is hitting .192 with three homers and five RBI and is expected to play some first base in the minors. Clay had a 10.38 ERA in six games with Washington.
Marlins: Miami placed OF Jorge Soler (bilateral pelvis inflammation) on the 10-day IL and activated Wendle from the IL. Soler is hitting .217 with 13 homers and 34 RBI. … SS Miguel Rojas left in the ninth inning. “He kind of banged into Joey and had a little reaction,” manager Don Mattingly said. “It almost felt like a little stinger. It just seemed like we should get him out of there and make sure he’s OK for tomorrow.”
Nationals: OF Victor Robles left with a bruised left shin in the fifth. Martinez said X-rays were negative and that Robles is day to day. … Washington activated RHP Mason Thompson (biceps strain) from the 60-day IL. Thompson pitched a scoreless ninth, his first action in the majors since April 9. … RHP Aníbal Sánchez (cervical nerve impingement) will make his second rehabilitation start for Triple-A Rochester on Sunday. ... LHP Josh Rogers (shoulder impingement) allowed seven runs in 3 2/3 innings Thursday in a rehab start for Rochester.
Marlins: LHP Daniel Castano (0-1, 2.57 ERA), who is 0-2 with a 6.75 ERA in three lifetime appearances against Washington, gets the start Saturday as the series continues.
Nationals: RHP Jackson Tetreault (2-1, 4.24) has won back-to-back starts for Washington, allowing one earned run in 13 innings in that span.
Moncada's RBI single gives ChiSox the lead
The White Sox take a 4-3 lead in the eighth inning thanks to an RBI single by Yoan Moncada to shallow center field.
Andrus homer, Langeliers double, lead A's past Rangers 5-1
— Elvis Andrus homered against his former team for the first time, Shea Langeliers doubled on the first pitch he saw in the big leagues and the Oakland Athletics beat the Texas Rangers 5-1 on Tuesday night, ending a nine-game losing streak.
Altuve cranks a solo shot to left field for Astros
The Astros extend their lead to 3-1 as Jose Altuve takes Dylan Cease yard in the fifth inning.
Elvis Andrus' 2-run home run has left the building
Elvis Andrus hits a 2-run dinger to deep left-center for the A's, scoring Sean Murphy.
O'Neill's game-ending HBP lifts Cards over Rockies 5-4
— Paul Goldschmidt and Tommy Edman homered, and St. Louis scored the winning run when Tyler O'Neill was hit by a pitch with the bases loaded in the bottom of the ninth inning, leading the Cardinals to a 5-4 win over the Colorado Rockies on Tuesday night.
Carpenter hits HR, Francona ejected as Tigers beat Guardians
— Rookie Kerry Carpenter homered for the second straight night and the Detroit Tigers survived a wild ninth inning to defeat the Cleveland Guardians 4-3 on Tuesday night.