The Post Sports Live crew debates whether the Nationals can still make it to the postseason, despite the hole they have dug themselves. (Post Sports Live)

Bryce Harper barely remembered the end, but he felt it. The details remained hazy — the ball bouncing around the red seats, his raised fist as he rounded first base, the mix of joy and relief that engulfed Nationals Park. All he knew was his body throbbed in the spot Ryan Zimmerman kept jabbing after his leap into a pile of waiting, exuberant teammates. “He was punching me in the frickin’ rib,” Harper said, smiling.

The celebration had come after Harper rescued the Washington Nationals, turning what could have been their most demoralizing loss yet into a 9-7, Band-Aid victory over the Pittsburgh Pirates. Their manager got ejected, their closer imploded and their season teetered until the moment, with two outs in the ninth inning Thursday afternoon, when Harper blasted his first career walk-off home run.

They snapped their six-game losing streak only after the Pirates tied the game with four runs in the ninth inning, a meltdown that included bench coach Randy Knorr’s bold yanking of $28 million closer Rafael Soriano for 22-year-old rookie Ian Krol as Manager Davey Johnson watched from the clubhouse, exiled after his first ejection of the season.

“Just walking into the clubhouse right now, you’d think we won the World Series or something,” Knorr said.

They won for the first time in 11 days after Gio Gonzalez had let one four-run lead shrink and Soriano had allowed another to disappear. They salvaged an offensive breakout that included Steve Lombardozzi’s 3-for-5, two-double sparkplug spot start. The timing and nature of the victory mattered far more to Harper than the way he crushed Bryan Morris’s hanging, 1-1 slider over the left-center field wall.

“I’m serious, I couldn’t care less about whether it went over the fence or if it was a double off the wall,” Harper said. “I don’t really remember any of the play. I kind of do. But I’m just very happy that we won the ballgame.”

The Nationals’ deficit in the National League East stood at eight games, and they still have work ahead to undo the damage from the first week of the second half. Harper’s walk-off, though, had at least given them somewhere to start, a burden lifted.

“If we had lost today, I think that would have been kind of a dagger for us,” said reliever Tyler Clippard, who pitched a scoreless eighth inning. “But we fought back. Today, we turned it around, which is huge for our confidence and our morale.”

The Nationals seized a 4-0 lead in the first inning, using Lombardozzi’s bunt single as a catalyst and capitalizing on three Pittsburgh errors. Gonzalez would match a career high with 11 strikeouts, but he also walked four and needed 119 pitches to pitch 52 / 3innings. Josh Harrison’s two-run homer in the fifth made it 4-3.

“You find out at the end you had 11 strikeouts,” Gonzalez said. “I kid you not, it felt like I only had six.”

The Nationals loaded the bases with no outs in the fifth, which led to Johnson’s ouster. Jayson Werth and Ian Desmond both struck out looking at fastballs off the outside corner. As Desmond fumed, Johnson screamed in home plate umpire Mike Winters’s face. Winters tossed him immediately. As Johnson walked to the showers, he ceded control to Knorr.

“That wasn’t my game,” Johnson said in a telephone interview. “It was Randy’s.”

The Post Sports Live crew debates whether the Nationals firing hitting coach Rick Eckstein will make any difference for the team’s disappointing offense. (Post Sports Live)

Lombardozzi’s RBI double and Adam LaRoche’s two-run triple gave the Nationals three insurance runs in the bottom of the eighth. Soriano needed to record three outs before the Pirates scored four runs. He invited disaster from the start.

Soriano walked the first two batters he faced. Jordy Mercer ripped an RBI double to the left-center field gap, and suddenly MVP candidate Andrew McCutchen was walking to the plate as the tying run. Soriano briefly stabilized the inning with a strikeout. Russell Martin, though, grounded a single to score another run.

“I was watching him pitch, and in the past, I’ve seen him pitch and when it’s not a save opportunity, he doesn’t have the same effect when he’s pitching,” Knorr said. “Figured, if you don’t want to be in that mode to shut the game down, I’ll bring somebody else in.”

With the tying runs aboard, Pedro Alvarez at the plate and one out, Knorr marched to the mound and took the ball from Soriano. And so Soriano — the two-time all-star with 25 saves this season, the longest-tenured major leaguer in the Nationals’ clubhouse — skulked off the mound, pulled for the first time all season. In jogged Krol. His first warmup pitch skipped to the backstop.

“Haven’t felt nerves like that since my debut,” Krol said. “So it was kind of crazy to be out there in that situation. Something that I’m not comfortable with. Something that I don’t normally do.”

Krol could not nail down his first major league save, but he managed to keep the score tied. He walked Alvarez, and two batters later he gave up a two-run, game-tying single to Harrison. Would Soriano have fared better or worse? Who can say? Undeniably, Knorr’s decision gave the Nationals a jolt.

“It’s not an easy decision to make,” Zimmerman said. “Nobody ever wants to do that to your closer.”

The Nationals faced their grimmest defeat yet, but they also had Harper lurking, due up fourth in the bottom of the ninth. Kurt Suzuki created the chance Harper would come to bat with a one-out single. Roger Bernadina made it two outs with a fielder’s choice. Up came Harper, who had not hit a home run since July 1, a span of 66 at-bats.

“You know he hasn’t hit one in a while,” Clippard said. “It’s like, something’s got to give eventually. You get that feeling that in those situations, that’s where he shines.”

“You could just feel it in the dugout,” Krol said. “You know something special’s going to happen when you put him in that kind of situation.”

Harper was not thinking about anything special. He only wanted to hit a ball in the gap, somewhere Bernadina could score the winning run. He took a slider for ball one and then blistered a liner down the first base line, just foul and just out of Gaby Sanchez’s reach. Standing on deck, Lombardozzi thought, “Get a hold of one right here.”

Morris hung a slider, and Harper hammered it. The ball flew over the left-center field fence. Harper floated around the bases, pumping his fist and yelling. His teammates waited for him at the plate. He squirmed out of the pile, Zimmerman still punching him in the side.

“I was ready to wrap it up today,” Zimmerman said. “That was a long game and we deserved to win.”

The party carried into the clubhouse — “music finally playing, people smiling,” Gonzalez said. Once it quieted down, clubhouse manager Mike Wallace approached Krol with the ball and lineup card, souvenirs from his first career win. Krol joked that he had always envisioned getting them under different circumstances, but he was still happy. “We got the win,” he said. “That’s all that matters, right?”