The Marlins salvaged a split, after losing, 7-4, in Game 1.
Jose Reyes had three hits and scored two runs, as he extended his hitting streak to 22 games, the longest active streak in the Majors. Carlos Lee added a two-run single and three RBIs.
What was shaping up as an inspiring bounce-back win after dropping the first game, dimmed with two outs in the ninth when second baseman Emilio Bonifacio sprained his left thumb. The speedster, who had an RBI single and stole his 30th base of the season, had surgery on the same thumb on May 25.
"Every time we win a game, we've got to send somebody down or make a roster [move], or somebody got hurt. It's very tough," manager Ozzie Guillen said. "Even though we win today, it's a very bad day for me. Losing Boni again puts us in a very tough situation. This kid brings a lot to the game."
Miami was able to scratch out enough offense off Nationals lefty Gio Gonzalez, who struck out 10 in eight innings. It was his seventh career double-digit strikeout performance, and third this season.
Until the July 31 non-waiver Trade Deadline, Johnson didn't know if he would still be with Miami. One reason the Marlins were asking for a high price for the former two-time All-Star is for what he showed on Friday.
Johnson downplayed his name being in trade rumors. And he said he wasn't extra motivated to prove critics wrong about him.
"I didn't think that," the right-hander said. "I'm out there for my teammates. I'm not trying to prove anything to anybody. I'm trying to go out there for my teammates and help them win games. That's it."
Using his curveball to complement his fastball and slider, Johnson became the first Marlins starting pitcher to go at least seven innings since Anibal Sanchez against the Pirates on July 22, a span of 11 games.
Johnson was one out away from his first complete game since April 26, 2010, a 10-1 win against the Padres.
"It was all Josh Johnson, really," Nationals manager Davey Johnson said. "He pitched a great ballgame. A little miscue by the center fielder, and we don't score. That's the best I've seen him. He was hitting his spots, making good pitches and keeping hitters off-balance. Good little slider, curveball, cutter, fastball."
Johnson settled in after allowing a first-inning run, and he gained momentum for Miami by working out of a leadoff-double jam in the fifth inning.
Michael Morse doubled to open the fifth, giving him a 12-game hit streak. And with one out, Roger Bernadina dropped a perfectly placed single that landed just fair in left. Unsure if the ball would be caught, Morse held at second. But Johnson struck out Sandy Leon with a curveball, and Gonzalez floated a lazy fly ball to center.
After escaping trouble on the mound, Johnson created some havoc with his bat in the sixth. He singled off the wall in right field, which set in motion a three-run inning.
Donovan Solano, Reyes, Lee and Greg Dobbs strung together four straight two-out singles. Lee's two-run single gave Miami the lead, and Dobbs provided some cushion with his RBI single to left.
In the eighth inning, the Marlins manufactured a run on hustle and a heads-up play by Reyes. Reyes first legged out a double, just beating the throw of right fielder Bryce Harper. Reyes then scored from second on Lee's groundout to shortstop. Reyes was running on the pitch, and kept going on Danny Espinosa's throw to first.
Johnson entered the ninth inning with 97 pitches, and he issued a leadoff single to Harper, who advanced to second on defensive indifference. With two outs, Morse slapped a grounder up the middle. Bonifacio made a diving, backhanded play, knocking the ball down, but injuring his thumb in the process.
Harper was being held at third, but in pain, Bonifacio flipped the ball to Reyes, who wasn't expecting it. The error allowed Harper to score.
"That's the way we roll," Guillen said of the season worth of misfortune.
Steve Cishek replaced Johnson and collected his sixth save, striking out Espinosa.
Johnson is now 9-1 lifetime against Washington.
"He's a good pitcher," Nationals third baseman Ryan Zimmerman said. "He's been up and down a little bit this year, coming back from injuries and stuff, but any time he takes the mound, he has the opportunity and chance to do that. He threw the ball well today."