Miami jumped out to an early lead against Jordan Zimmermann, only to watch a five-run advantage slip away. They even regained the edge at 7-6 in the eighth inning on Garrett Jones' RBI double.
In all, the Marlins slapped out 14 hits, and had home runs from Derek Dietrich and Jarrod Saltalamacchia. But no matter what they did offensively, they were hurt by spotty pitching and three errors.
Along with Werth's grand slam, Bryce Harper added a three-run homer for Washington.
"To come out swinging the bats like we did against a great pitcher. But, hey, these guys have the ability to put big numbers up quickly," Marlins manager Mike Redmond said. "You saw that tonight. They scored seven runs on two swings. It takes us 14 hits to get seven runs."
The Marlins have now lost three straight and slipped to 5-4. They have a chance to salvage one game with the finale set for Thursday afternoon.
"Forget about this game and move onto tomorrow," Saltalamacchia said. "That's what it's all about. For me personally, I'm getting a feel for them and how they play the game. I'm learning. It's about who can forget this game and move onto tomorrow."
Despite losing leads and making mistakes in the field, the Marlins still led heading into the bottom of the eighth. Steve Cishek was primed for the ninth, but he never got a save opportunity.
With one out, Marmol got into trouble when he hit pinch-hitter Nate McLouth with a slider.
"My slider was moving a little too much to that side the plate," Marmol said. "He just stayed there and the ball hit him. It's his job to get on base, especially late in the game."
The inning unraveled quickly from there.
Denard Span reached on a bunt single, and on the play third baseman Dietrich's throwing error put runners on second and third with one out. Miami gambled and walked Anthony Rendon intentionally to load the bases.
"From the fourth inning on, it was a struggle to try to hold these guys down," Redmond said. "We used a lot of pitchers. We just couldn't find a way to get those big outs and get it to Cishek in the ninth."
Werth made them pay, belting a one-strike pitch for his first grand slam with Washington.
"I wasn't shocked [that they walked Rendon]," Werth said. "There is a few ways to play that. It was one of them for sure. It worked out. I was more [angry] about the strike one call than anything else."
In a tough spot with runners on second and third and one out, Redmond rolled the dice by walking Rendon.
"I was trying to win the ballgame there, trying to get a ground ball if we could," Redmond said. "Rendon has been swinging the bat really good, as well."
Dating back to last year, the Marlins are 1-11 at Nationals Park. They scored a combined 15 runs at Washington over their last 11 games.
The bats got going, but the pitching and defense faltered.
Miami regained the lead in the eighth on Jones' RBI double, which scored Christian Yelich, who reached base five times.
Yelich opened the eighth with a walk off Tyler Clippard. Giancarlo Stanton also walked, and Jones' double bounced off first base and rolled into the corner in right field. Yelich scored easily. Stanton also attempted to score, but he was thrown out at the plate. Werth threw to second baseman Rendon, who threw to catcher Jose Lobaton. Stanton tried to slide his hand in, but was tagged out.
The umpires took on replay and confirmed the out call.
Both starters had a rough time. Miami knocked Zimmermann out of the game after 1 2/3 innings, scoring five times.
But Brad Hand wasn't able to protect a five-run lead, and he exited after 3 1/3 innings, allowing three runs on the Harper homer. Kevin Slowey in 1 2/3 innings was charged with three runs, two earned.
"I was trying to throw a fastball down-and-away, and it kind of went in, right into his happy zone," Hand said. "That's where he likes the ball. Missed location."
Harper's blast in the fourth inning inspired a five-run comeback, and the Nationals pushed two runs across in the sixth inning to take a 6-5 lead. Miami committed two errors in the inning. Ryan Zimmerman doubled to right and advanced to third on Stanton's error for bobbling the ball. Ian Desmond tapped an infield RBI single to even the score.
"It seems like every time we got ourselves in good position, we made a mistake that cost us," Redmond said.