Gerardo Parra pumps his fist after hitting an eighth-inning grand slam to lift the Nationals to a 5-2 win over Los Angeles. (Marcio Jose Sanchez/Associated Press)

It was either the swing, or the sound, or perhaps how the baseball soared above Dodger Stadium, because the Washington Nationals’ dugout was dancing well before Gerardo Parra’s grand slam cleared the right-center field wall and settled into the pale yellow bleachers.

Once it landed, and the scoreboard ticked in Washington’s favor on Saturday night, a mosh of players waited for Parra at the bottom of the dugout steps. Then they smacked his helmet and his back and his side and finally let him go once his jersey was ruffled and a smile was stretched across his face. He had been their teammate for all of three days, signed to a one-year deal Thursday, and had just delivered the biggest hit of the season with two outs in the eighth.

And that delivered a 5-2 win over the Los Angeles Dodgers, right when it looked as if the Nationals would waste another gutsy effort from ace Max Scherzer. He gave up only two runs in seven innings, throwing a season-high 115 pitches in the process, and was narrowly outdone by seven scoreless frames from Walker Buehler. But this time the Nationals bullied an opponent’s bullpen on their way to a comeback victory.

They are now 16-23 and, with one day left of a trying 10-game road swing, are maybe showing some signs of life.

“Ah, we needed this,” said Scherzer before letting out a laugh, his excitement mixed with a measure of relief. “That was a heck of an inning for us.”

The game had the markings of a pitchers’ duel, at least at the beginning, at least until each starter handed the ball to their team’s relievers. Buehler is one of baseball’s brightest young pitchers, a 6-foot-2 right-hander with a high-90s fastball and curve to match. Scherzer, on the other hand, is maybe the best of his generation, a three-time Cy Young Award winner, the kind of pitcher Buehler watched to plot his path from high school to college to right here, staring him down.

That’s what clashed at Dodger Stadium on Saturday evening: two electric arms. A 24-year-old with loads of potential. A 12-year veteran who believes he still can improve. Except only one of the teams had maximized the talent of its starter to this point of the year. Buehler entered with a 4-0 record despite a 4.95 ERA. The Nationals had won just one of Scherzer’s eight outings heading into the game. That only magnified the importance of backing Scherzer’s effort, whatever it was, and Washington did after falling behind on his one mistake.

Scherzer worked around base runners in two scoreless frames, using a pair of strikeouts and a second-inning double play to do so. Then he walked Max Muncy with two outs in the third and, on a 2-1 pitch to Justin Turner, left a four-seam fastball up and over the plate. Turner ripped it over the right-center field fence for a two-run homer that, until the eighth, looked to be the decisive blow. Scherzer was otherwise dominant and his teammates would eventually follow.

“I think the biggest moment was the way Scherzer threw today,” Parra said, passing some credit to the Nationals’ starter. “He threw like a Cy Young.”

The Nationals nearly got to Buehler right away when Adam Eaton led off with a single and Victor Robles reached on a push bunt to the right side. Both runners moved up on a throwing error. Then Juan Soto, in his first at-bat since coming off the injured list, had two runners in scoring position with no outs. He worked a seven-pitch walk to load the bases, but Dodgers catcher Austin Barnes fired the ball to second.

Robles was leaking far off the base and was tagged out. He thought the umpire had called time and was walking to speak with third-base coach Bobby Henley, but instead helped the Nationals waste a critical chance. Robles, their budding center fielder, has mixed bursts of promise with sharp reminders of his age this year. This was an extreme form of the latter. Instead of becoming the first team to score a first-running run on Buehler this season, the Dodgers landed the first blow.

“He plays the game the right way, he plays hard,” Manager Dave Martinez said of Robles’s lapse. “But sometimes the 21-year-old comes out.”

Once Buehler had the lead, however slight, he carved through Washington’s order one off-balance hitter at a time. He yielded a leadoff double to Anthony Rendon in the fourth but retired the next three Nationals. Then he struck out the side in the fifth and had set down 12 straight batters when he exited after two more frames.

But that left the Nationals with a few final breaths against the Dodgers’ bullpen. Their eighth-inning rally started with a single from Difo and a throwing error from Turner that allowed pinch hitter Howie Kendrick to reach. Eaton bunted into a force out at first, Robles walked to load the bases, and Soto worked a nine-pitch at-bat before he singled in Difo. Then Rendon struck out, swinging through a diving sinker, and Parra walked to the plate with three runners on and two out.

“Just hit the ball,” Martinez said of went through his head as Parra dug in. “Just get a base hit. But slow motion, in your mind, what a really beautiful swing.”

The 32-year-old, typically an outfielder, started at first base because Ryan Zimmerman and Matt Adams remain out with injuries. Parra first watched two fastballs go by, twitching his muscles but resisting a swing, and then Dylan Floro evened the count with two strikes. But Parra had the last word, connecting on an uppercut swing, and he tracked the blast from the box before trotting up the first base line.

As he did, the ballpark falling quiet around him, Parra looked into the dugout and pumped his right fist. His teammates already were deep in celebration. They knew it was gone once bat met baseball, and they had no interest in holding back.