Two errors in the sixth inning by Marlins catcher Jarrod Saltalamacchia helped the Nationals overcome a 3-0 deficit. Pinch-hitter Zach Walters broke a tie in the eighth inning with his second career homer - and his second in as many nights.
The Nationals took the rubber game of the three-game series despite being without four starters, including Bryce Harper, a late scratch because of a tight left quadriceps that has bothered him since Friday.
Fernandez, betrayed by his defense, departed for a pinch-hitter after seven innings. He allowed four hits and three runs, all unearned, with 10 strikeouts and no walks.
The Marlins' precocious ace allowed only one baserunner in the first five innings, but Saltalamacchia's throwing error led to three runs in the sixth. Werth's two-out homer, his third of the season, tied the score at 3.
Tanner Roark allowed three runs in 6 1-3 innings, and the bullpen pitched the final 2 2-3 innings without allowing a runner. Drew Storen (1-0) got the final two outs in the seventh, and Rafael Soriano pitched the ninth for his third save in as many chances.
Washington improved to 5-1 against the Marlins this year and 14-3 against them since July.
Miami's Derek Dietrich hit a tape-measure three-run homer, his third. The Marlins have homered in eight consecutive games after finishing last in the majors in home runs in 2013.
Giancarlo Stanton, baseball's RBIs leader, went 0 for 4, including two at-bats with runners in scoring position.
Fernandez remained 11-0 at home and became only the third major league pitcher since 1914 to go unbeaten in his first 18 home starts, according to STATS. And he appeared headed for a victory until the sixth.
After Jose Lobaton led off with a double, Saltalamacchia made an ill-advised throw to third on a bunt, and both runners were safe when the throw was errant. With one out, Saltalamacchia dropped a pop foul for another error that forced Fernandez to throw extra pitches.
Werth's homer deflected off the hands of a fan in the first row of the right-field seats. The ruling was upheld by a replay review that took only 22 seconds.
NOTES: Nationals OF Denard Span (concussion) is expected to begin a rehabilitation assignment Thursday and may rejoin the team Saturday. ... Washington RHP Doug Fister (back muscle) is scheduled to pitch two innings Thursday in an extended spring training game in Florida. He'll pitch at least twice more after that before joining the rotation, perhaps in early May. ... Jones came into the game leading the majors with 24 strikeouts, but didn't fan in this one. ... The Nationals begin an 11-game homestand Thursday against St. Louis, with Taylor Jordan (0-1, 4.76) slated to pitch against Adam Wainwright (2-1, 2.57). ... The Seattle Mariners visit Miami for only the second time, and the first time since 2005, to begin a three-game series Friday.