Cameron Maybin is tagged out at the plate by Nationals catcher Pedro Severino on Saturday. Maybin was running on contact and tried to score on a groundball to first baseman Mark Reynolds. (Steve Mitchell/USA Today Sports)

Wilmer Difo made the home run signal as he sprinted around first base, and he didn’t slow down. He galloped all the way around, his excitement filling a hollow Marlins Park and his energy invigorating the Washington Nationals’ dugout. He pounded his chest and doled out violent high-fives. He gave the Nationals life.

Difo’s game-tying rocket off the left field foul pole in the eighth inning was the kick the Nationals needed in their 4-1 win Saturday afternoon. They had been comatose against Wei-Yin Chen, previously an owner of a 6.55 ERA, and were wasting another standout performance from Tanner Roark. They were about to squander a chance to pile on another victory against an inferior foe and make up more ground in the National League East standings. Difo’s blast and dash flipped a switch.

“I knew their lefty was doing a good job and was holding us down,” Difo said in Spanish. “And then with that home run, thank God, the team changed.”

Mark Reynolds rode the momentum swing in the ninth inning, launching a leadoff moonshot off Brad Ziegler for his 10th career go-ahead home run in the ninth inning or beyond. Minutes later, after 19-year-old Juan Soto collected his second double, Matt Adams and Trea Turner delivered RBI singles as the Nationals (28-22) extended their winning streak against Miami to 10 games.

“All it takes sometimes is one swing to get a little energy in the club,” Reynolds said, “and Difo did that for us today.”

Washington’s early struggles against Chen left little margin for error for Roark, who entered the day having received three total runs of support over his previous three starts. After facing one batter over the minimum through three innings, Roark confronted his first predicament in the fourth. JT Realmuto led off by smacking a double down the left field line. Two batters later, Starlin Castro worked a walk. Brian Anderson then slashed a groundball through the right side to score Realmuto for the game’s first run.

It could have been worse, and nearly was, for Roark. Miguel Rojas grounded into an inning-ending double play, but the Marlins (19-32) challenged when Rojas was called out at first base. A slow-motion replay was shown on the video board, and the crowd and much of the Marlins dugout believed Rojas to be safe, which would have given Miami another run. But after a review of nearly two minutes, the call stood and Roark escaped.

The Marlins put a runner on second base in the sixth inning and another on third in the seventh against Roark but couldn’t drive either home for insurance. Roark walked off the mound at the end of the seventh inning having thrown 111 pitches, allowing one run on four hits.

“Tanner pitched unbelievable,” Nationals Manager Dave Martinez said. “He kept us in the ballgame. Tried to keep him in there, see if we can get a win for him. . . . But he pitched, again, phenomenal.”

On the other side, Chen was silencing the Nationals’ bats. Mixing and matching with a four-pitch arsenal, the left-hander held the Nationals to two hits through seven innings, struck out Bryce Harper three times and logged four 1-2-3 innings. But he finally paid for a mistake in the eighth, a slider over the heart of the plate that Difo whacked.

The Marlins threatened to snatch the lead back in the bottom of the inning. It began with Cameron Maybin, pinch-hitting in the pitcher’s spot, lining a single against left-hander Tim Collins. Two batters later, Realmuto doubled to bring up Justin Bour with runners on second and third and one out. Collins induced a groundball to Reynolds at first base, and Reynolds smoothly threw home to get Maybin for the second out.

With the right-handed hitting Castro up next, Martinez inserted Justin Miller, a right-hander, to make his Nationals debut and first appearance in the majors since 2016. Miller swiftly disposed of Castro, striking him out on three fastballs to ace his first test in a Washington uniform and earn the win.

“We gained momentum there,” Martinez said. “And then all of a sudden, here we go, Mark Reynolds comes up and gives us a blast and we got going.”

From there, Sean Doolittle entered to secure the final three outs and avoid a loss the Nationals know would have stung in retrospect. Nobody on the Nationals will voice the obvious, at least not publicly, but the nine-game stretch they were smack dab in the middle of Saturday is a golden opportunity. The nine games against three last-place teams, clubs with more invested in nabbing the top pick in next year’s draft than fighting for a postseason berth, provide a chance to quickly make up ground in a competitive National League East.

Five games in, the Nationals are 4-1. So far, they are taking advantage. On Saturday, they just needed a jolt.