Jayson Werth’s three-run home run fall beyond the reach of Giancarlo Stanton in the sixth inning as the Nationals take two of three in Miami. (Lynne Sladky/Associated Press)

The Washington Nationals put themselves in a position Wednesday night that has become all too familiar during the early stages of this season. Their starter dug them an early hole and the offense was left to cover up the mess. This time, it was starter Tanner Roark who yielded three fourth-inning runs, leaving the Nationals the unenviable task of having to rally against Miami’s Jose Fernandez, one of the league’s top young pitchers.

But with one powerful sixth-inning swing from right fielder Jayson Werth, the Nationals made up the deficit against Fernandez. Two innings later, rookie Zach Walters delivered a pinch-hit home run against the Marlins’ bullpen in a 6-3 come-from-behind win.

Against Fernandez, the 2013 National League rookie of the year, Werth drilled an opposite field home run in cavernous Marlins Park that tied the game at 3. It stayed that way until Walters clanked a ball off the scoreboard beyond the left field seats in the eighth.

After struggling to do so last season, the Nationals (9-6) have come back to win five times in 15 games and have outscored opponents 38-14 from the seventh inning on. The firepower came in handy, although Roark settled down after his rocky start to last 61 / 3 innings.

“We’ve got good energy in the dugout,” Werth said. “We’ve been upbeat all year. I don’t think that at any point in any game except for maybe [Tuesday night’s] game we felt that we were out of it. We feel like we can come back no matter who is out there.”

The Nationals are hitting well—for now. When will the dreadful fielding and injury woes catch up? The Post’s Adam Kilgore discusses the early highs and lows for the team. (Post Sports Live/The Washington Post)

The drama came in the eighth. Manager Matt Williams sent the switch-hitting Walters to bat for reliever Drew Storen. Left-handed reliever Mike Dunn hung a 1-0 slider to Walters, a 6-foot-2 infielder who hit 29 home runs at Class AAA Syracuse last season. Walters crushed the pitch, his second home run in as many at-bats.

“He’s got a good slider, and for him to throw it for his first pitch kind of helped me out in seeing it,” said Walters, who got hit with the rosin bag and a plate of shaving cream in the clubhouse after the game. “I was looking for a fastball, and he happened to leave a slider up again and it stayed fair.”

Ian Desmond, who helped Storen out of a jam in the seventh by starting a tough double play, singled in a pair of insurance runs later in the inning, giving Rafael Soriano plenty of cushion to seal the victory. The Nationals won without the hot bat of Bryce Harper, who was scratched shortly before first pitch with tightness in his left quadriceps.

As impressive as the offense has been, the Nationals were desperate for a strong performance from a starting pitcher. Nationals starters entered with a 5.06 ERA through 14 games, the fifth-worst mark in baseball. Starters were averaging about 51 / 3 innings per start, putting pressure on the bullpen.

The game began as a pitcher’s duel. The first three innings had a combined four base runners. Fernandez moved through the Nationals’ lineup with overpowering stuff. In the fourth inning, he struck out the side of Anthony Rendon, Werth and Adam LaRoche, making each look uncomfortable in the process.

“He’s an animal,” Williams said. “He’s one of the best pitchers in baseball.”

Roark’s struggles came in the fourth when he allowed a leadoff single to Garrett Jones and then another single to Casey McGehee. Roark got Jarrod Saltalamacchia to fly out, but he left a fastball over the plate to Derek Dietrich, who swatted it into the seats in right-center field for a 3-0 lead.

The Nationals rallied in the sixth. Jose Lobaton led off with a double, and Roark reached when he dropped down a sacrifice bunt and Saltalamacchia threw errantly to third in a bid to get Lobaton. Fernandez was poised to wriggle out of the jam after he struck out Nate McLouth and Rendon, but he made a mistake to Werth.

Before the other two games of this series, Werth smashed balls over the fence during batting practice but couldn’t do so in the game despite his best efforts. He hit two flyballs Monday that would have been home runs in other stadiums. Since Marlins Park opened in 2012, Werth wondered what it would take to finally deposit a ball into the seats for the first time here.

“This park is so big you really just don’t know,” he said. “Most other parks it’s probably a no-doubter. Here it’s scraping the back of the fence.”

Ahead in the count 0-1, Fernandez fired a 96-mph fastball that caught too much of the plate. Werth uncorked his compact, powerful swing and sent the ball deep to right-center. Although a fan accidentally sent the ball back onto the field in a failed effort to snag the home run, umpires — and replay — determined the blast was, in fact, a home run.

“He told me when he came back to the bench that he hit that ball as good as he could hit a ball,” Williams said. “It’s a big yard. And especially the other way, it’s hard to do.”