The Marlins scratched out just enough to get the best of Stephen Strasburg, who yielded four hits and struck out four in seven innings.
The Marlins extended their winning streak to six games, and they have taken nine of 10. Suddenly, the re-energized team is frantically working the phones trying to make additions before Thursday's non-waiver Trade Deadline.
"Those guys are excited," Miami manager Mike Redmond said. "There's a lot of confidence in there. They're having fun. We're relaxed. We feel like we're in the game no matter what happens, even if we go a few innings without scoring or getting a hit."
Miami climbed back to .500 (53-53) for the first time since June 25 (39-39). It was a long haul back, especially after dropping to a season-worst eight under (44-52) on July 19.
Stanton, who now has 71 RBIs, says any additions would be welcome.
"Any help we can get to make us better is always good," Stanton said. "You never know what it's going to be, or if there are going to be ones. But any additions will help."
Once again Alvarez stepped up like an ace. Miami has won 12 of his last 14 starts.
"Henderson was great," Redmond said. "It looked like early he didn't have his best stuff. It kind of took him a little bit of time to settle into that game and get in a flow. We talk about pitchers some nights not having their best stuff and having to compete, and I think you saw that tonight -- competing and battling without his best stuff."
At first, it looked like it would be a rough outing for the right-hander, who was wild early and appeared to be injured. He was tended to on the mound in the second inning after walking two and loading the bases with no outs.
If anything was wrong, it quickly turned right. Alvarez scattered just three hits over his seven shutout innings. Although he had a season-high four walks, he struck out four and exited after 102 pitches with a one-run lead.
"I didn't feel very good. I was in the bullpen and I didn't feel like I always feel before I hit the field," Alvarez said. "I wasn't into it. For several innings, I had to fight through it."
The Marlins broke through in the sixth inning on Jordany Valdespin's single and Stanton's scorched liner to left that traveled to the wall. The RBI was Stanton's 70th of the season.
"I haven't felt good for a while now," Stanton said. "I did a little setup pregame. Hopefully I'm feeling better and more comfortable at the plate. Today was a good plus to that."
Asked why Stanton continues to torture the Nationals, Strasburg said, "He is a good mistake hitter. I just got to do a better job executing pitches."
In the eighth, the Nationals put the pressure on when Bryan Morris walked two, including Wilson Ramos with two outs. Mike Dunn entered to face Bryce Harper, who popped a first-pitch slider to short left field that was collected by shortstop Adeiny Hechavarria to end the inning.
Christian Yelich delivered an RBI double and Stanton added an RBI single in the eighth to drive in insurance runs for Steve Cishek, who pitched a scoreless ninth for his 27th save. Cishek did have to work, as he loaded the bases, but the closer ended the game by striking out Anthony Rendon.
Pinpoint command is one of the reasons Alvarez has been so successful and was named an All-Star for the first time.
So when the right-hander walked three in the first two innings, including two in the second inning, the Marlins were concerned. Redmond, pitching coach Chuck Hernandez and assistant trainer Mike Kozak visited the mound after Alvarez walked Ian Desmond to load the bases with no outs in the second.
Alvarez insisted he was fine, and he worked out of the major jam. It took 33 pitches, but the right-hander left the bases full by striking out Danny Espinosa. Nate McLouth slapped a liner that could have done big damage, but it was snared by third baseman Casey McGehee, who made a diving catch and nearly rolled onto third base for a double play. The threat ended when Strasburg, with the count full, bounced to second.
Entering the night, Alvarez had walked three batters total in 29 2/3 innings in July.
"It's good to have a good game like this," Alvarez said. "Not just for myself but for the team. We need to keep working hard, going out there and keep getting these results. It's good for the fans as well, for the fans who come out and support us."