Nationals reliever Blake Treinen pitched a scoreless seventh after Matt Albers and Oliver Perez both gave up runs to start the inning. (Charles Leclaire/USA Today Sports)

If you believe that one moment can shift baseball momentum, that an inning or a swing or a pitch can change a team’s course — at least in the short term — then the Washington Nationals’ bullpen could be an interesting case study.

As of the seventh inning of Tuesday night’s 8-4 win over the Pittsburgh Pirates, the Nationals’ bullpen had accumulated more negative momentum than a boulder rolling down one of the many Pittsburgh hills. A five-run lead was in peril, sliding away fast. Then Blake Treinen put his foot down, interrupting the skid.

Maybe it will not matter tomorrow, this weekend, or a week from now. Perhaps the bullpen will continue its slide. But on one warm night on the Allegheny, Treinen changed the momentum, and Enny Romero and Koda Glover followed, aided by a two-run home run by Bryce Harper in the ninth that gave the Nationals more room to breathe. It was Treinen who helped the bullpen catch its breath.

Treinen entered the game with two on and no one out in the seventh, with three runs already in, thanks in part to three hits, a walk, and an error by Ryan Zimmerman.

By the time Treinen entered, Stephen Strasburg, Matt Albers, and Oliver Perez had all tried to quell the trouble in the seventh alone. By the time Treinen entered, all of them had come and gone, unable to record an out. Things were falling apart, as they had all week, as seven straight games were decided in the seventh inning or later.

But then Treinen got a double play ball, the kind of huge, game-changing, rally-killing double play ball he got all last year. Then he struck out Andrew McCutchen, still among the more threatening hitters in a weak Pirates lineup despite a slow start. Instead of a tie game, or a one-run lead, Treinen helped the Nationals get through the seventh with some cushion.

Romero worked a 1-2-3 eighth. That left one inning, three more outs, to whoever Manager Dusty Baker felt could get them. He chose Glover ahead of Shawn Kelley, the most recently named closer. Kelley had allowed three home runs in his past four outings.

Glover got two outs before allowing a bloop single and a double to left. He struck out Josh Harrison to end the game. Asked if Glover will get consistent opportunities in the ninth — a.k.a., become the Nationals’ closer — Baker dodged.

“Well, we gave it to him tonight,” Baker said. “We’ll see.”

The Nationals (25-13) kept their hold on the best record in the National League. On nights like Tuesday, when the bullpen handles the later innings and the offense adds late, they look like a team deserving of an eight-game lead over the rest of their National League East competition.

“We’re still in the process of trying to figure it out and get it together,” Baker said. “In the meantime, our offense is doing the job.”

The offense remains the key for these Nationals, the thing that has helped them overcome early injuries and their bullpen, the thing that has helped prevent late-inning struggles from scuttling a season.

It entered Tuesday as the best in baseball in almost every relevant category — batting average, on-base percentage, slugging percentage, etc. They began the day second in run differential, perhaps the most telling statistic of all.

For all the explosiveness in the middle of the order, the separating factor for the Nationals’ lineup is its depth. Daniel Murphy rested Tuesday, yet the Nationals kept hitting. By the seventh inning, every batter in the starting lineup had a hit, the depth of their lineup best explained by the fact that Harper was the last to get one.

Harper, Trea Turner, and Ryan Zimmerman had two hits each. Jayson Werth finished with three. Wilmer Difo homered. Michael A. Taylor tripled. Combined with six innings of three-run ball from Strasburg, who succumbed in that seventh inning, the Nationals had given the bullpen plenty of room to breathe heading to the seventh. Thanks to Treinen, it escaped with a two-run lead heading to the ninth.

Then came Harper’s two-run shot, which gave him a home run in every National League park, something he said he was keenly aware of, and had been trying to take care of for years now. After that home run, Baker said, Max Scherzer started a chant in the dugout.

“Screw the save!” he called, a fitting motto for a Nationals team seemingly determined to score so much that its bullpen can absorb some bumps and bruises. As it happened, Glover let what would have been the tying runs on base in the ninth. He did not let any of them score.

He, Romero and Treinen combined to do what the Nationals’ bullpen has struggled to do for much of the season — hold a lead through the late innings. Now there is positive momentum. Now there is recent memory of an escape.

“It’s good to see some positive results,” Trienen said. “I thought everybody threw the ball really well tonight. I just wanted to do my part.”

It might not lead to anything at all, but an inning like that from Treinen, and the innings that followed from Romero and Glover, seemed like exactly what the Nationals needed.