Rod Barajas of the Pirates is the victim of a postgame shaving cream pie to the face after his game-winning two-run walk off home run in the bottom of the ninth. (Jared Wickerham/Getty Images)

Silence pervaded the Washington Nationals’ clubhouse Tuesday night. Players stared into lockers, forks scraping plates the only audible noise. They tried to unpack how such a jubilant night could have turned so sour, how a stirring victory had morphed into a deflating loss.

Ryan Zimmerman returned after two weeks on the disabled list and sparked a ninth-inning rally. Adam LaRoche, playing his first game after missing four, drilled what seemed like a dramatic, decisive home run against his old team. And yet the Nationals skulked off the field at PNC Park minutes later, dazed after closer Henry Rodriguez yielded a walk-off home run to Rod Barajas that gave the Pittsburgh Pirates a sudden, 5-4 victory before 10,323.

“It’s pretty tough,” catcher Wilson Ramos said. “We changed the score, we’re winning, we’re getting a little bit excited. But we have to play nine innings, you know? We have to finish the game.”

After Zimmerman went 1 for 4 in his first game since April 20, Bryce Harper smacked his sixth double in nine big league games and Edwin Jackson allowed three hits — two of them solo homers — in seven innings, the Nationals could not finish Tuesday. Coupled with the Atlanta Braves’ victory, the Nationals (18-11) dropped into a virtual tie for first place in the National League East.

The sight of their best player for the first time in two weeks eased the Nationals’ sting from playing their first of perhaps 60 games without Jayson Werth. And then, as Rodriguez blew his second save this season, a different kind of pain surfaced in the final moments.

After LaRoche gave the Nationals the lead, Rodriguez retired the first batter he faced in the bottom of the ninth inning. Pinch-hitter Alex Presley blooped a single to shallow left, typically the only kind of hit opponents get off Rodriguez, who had allowed opposing hitters a .146 slugging percentage this season.

Facing Yamaico Navarro, Rodriguez lost control of his curveball. After getting ahead 0-2, he bounced two breaking balls, both of them getting away from Ramos, giving Rodriguez six wild pitches on the season.

“I tried to be too perfect,” Rodriguez said through teammate Jesus Flores, who interpreted. “I missed the spot and I tried too hard.”

Rodriguez still blew away Navarro with a 99-mph fastball. As Barajas walked to the plate, they could count on the game at least not ending with one stunning swing. Rodriguez had allowed only one home run since he came to the Nationals, to catcher John Baker on July 26, 2011. He had faced 182 batters since, 43 innings without allowing a homer.

Except now, circumstances had turned him into a one-pitch pitcher. With no control for his curve, the Nationals could not risk an off-speed pitch with the tying run on third base.

“For me, he’s cheating in that situation,” Ramos said. “He’s cheating to the fastball.”

Rodriguez unleashed a 96-mph fastball on the inside half of the plate. Barajas, like so few hitters have done against Rodriguez, turned on it. The ball sailed into the left field stands. Fireworks exploded behind the center field fence. Rodriguez walked off, stone-faced.

“I want to challenge him inside,” Rodriguez said. “But he was lucky he got it in front.”

Rodriguez also said he needed to look for a better pitch sequence, knowing when to use his curve. In Ramos’s mind, he had only one choice.

“They don’t have command of the breaking ball, we have to call fastball,” Ramos said. “He’s got a good fastball, good speed, you have to use it.”

The final pitch spoiled a dramatic ninth. As Pirates closer Joel Hanrahan threw his final warmup pitches, Zimmerman and LaRoche stood next to one another by the on-deck circle. The Nationals trailed by one after the Pirates made it 3-2 in the eighth inning. But “we had the right guys in there,” Manager Davey Johnson said.

Zimmerman delivered, as he so often does. He laced a 2-2, 95-mph fastball to left field. Nate McLouth charged the sinking liner, but the ball trickled off his glove, putting the tying run on base. Zimmerman never felt his inflamed shoulder joint all night.

“It’s fun,” Zimmerman said. “Your teammates are looking for you to get something going. Those are the pressure situations that you want to do well in. That’s why you play the game. That’s why you work so hard. I felt good at the plate in all my at-bats.”

Zimmerman’s single brought up LaRoche, who had missed four games with a sore right oblique muscle. LaRoche took three balls, which allowed him to wait for one pitch. “He doesn’t want to put the tying run on second base,” LaRoche said.

With the count 3-2, Hanrahan, the former National, fired a 97-mph fastball, his hardest pitch of in the inning. LaRoche unloaded with his smooth swing. As his team-high fifth home run landed in the seats, the Nationals’ dugout erupted.

“It felt nice that I could get up there and take full swings with my side the way it’s been feeling,” LaRoche said. “In that regard, it would have been nice for that lead to hold up.”

LaRoche’s homer had momentarily taken Tyler Clippard and Ian Desmond off the hook. With one out in the bottom of the eighth and the score tied, Clippard walked McLouth. With Jose Tabata at the plate, McLouth bolted to steal second and move the go-ahead run into scoring position. As Desmond darted to cover the base, Tabata drilled a one-hopper up the middle — right at him, a good-luck double play.

Except it skipped through Desmond’s legs. “I never really saw the ball,” he said. One batter later, Neil Walker smacked a go-ahead sacrifice fly to right field.

The Nationals will show up Wednesday with Zimmerman and LaRoche still in their lineup, both of them feeling healthy again. In the moments after Tuesday night, they found little immediate solace. “Tough loss,” LaRoche said, standing in an otherwise quiet clubhouse. “Tough loss, man.”