Bryce Harper blasts a two-run homer to break open a tie game in the seventh inning Friday night. The Nationals went to a 5-3 win over the Miami Marlins. (Jonathan Newton/The Washington Post)

The moment Kyle Barraclough saw Bryce Harper make contact, he hopped on the mound, looked down and let out a yell. The ball sailed into the first deck in right field, a two-run home run in the seventh inning that propelled the Washington Nationals to a 5-3 win. The Miami Marlins chose to pitch to Harper with the game on the line and paid dearly.

Miami pitched around Harper in his first two plate appearances. In his third at-bat, he poked a single through the infield. His fourth trip changed the game.

When Anthony Rendon walked to lead off the seventh, Marlins Manager Don Mattingly, with no left-handers in his bullpen, had to stick with the hard-throwing Barraclough, who tried to sneak a 3-2 slider past Harper. Instead, the pitch spun over the plate and Harper pounced.

Since his previous home run, Harper had drawn 20 walks. Hittable pitches have been few.

“Just try to think to yourself that you’re swinging every single time and not get lazy and not get surprised by a pitch down the middle or something on the outside half that you can drive,” Harper said. “I just try to stay within myself every time and it’s definitely tough. But I try and do some damage when I can.”

Harper’s home run was one of three on the night for the Nationals, the other two coming via pinch hitters Stephen Drew and Chris Heisey, marking the first time in team history Washington had more than one pinch-hit home run in a game. The Nationals have six pinch-hit home runs this season, second-most in baseball.

“Just trying not to overswing, to just stay loose and be ready,” said Drew, a former everyday player still getting accustomed to a bench role and pinch-hitting. “As of late, I’ve gotten better at it. I try not to take too many swings in the cage, just be ready throughout the game. But also you want to be able to have that good feel when you go up to bat, like you’ve already had three or four at-bats in your mind.”

The Nationals dug themselves an early deficit thanks to some poor defense and tough luck. The main culprit for the miscues: Daniel Murphy, who, until now, had masked his defensive reputation with the hottest bat in baseball.

But the fifth inning started with Gio Gonzalez walking Marcell Ozuna. Gonzalez got Chris Johnson to roll over a pitch, producing a perfect double-play ball. But Murphy couldn’t make the play, putting two runners on before matters got worse. With one out, Miguel Rojas hit a groundball to Murphy, who made a late throw to first base after a bobble.

Gonzalez and Ryan Zimmerman both covered first, though each was a step late. Murphy’s throw sailed past them and by the time Zimmerman tracked it down near the dugout it was 2-0.

“I have to do my job in getting over,” Gonzalez said. “That’s definitely on me.”

An inning later, after managerial maneuvering by both sides, the Nationals were thrown a life vest by Drew. In the top of the sixth, the Nationals escaped a jam when Dusty Baker turned to relievers Yusmeiro Petit and Oliver Perez.

With no outs, Gonzalez gave up three straight groundball singles. Baker opted for Petit, a long reliever who faced only one batter — and struck him out — because the Marlins also made a move. Mattingly called for left-handed pinch hitter Derek Dietrich, forcing Baker to go to left-handed Perez, who induced an inning-ending double play on his fourth pitch. Perez bounced off the mound with a fist pump.

“It was a full team effort tonight,” Baker said. “I mean big time because they could have blown the game open there, and they had some guys over there that are qualified to blow the game open. We made some good pitches and made some good defensive plays when we needed to.”

Drew continued the momentum in the bottom of the inning, smashing a pinch-hit two-run home run to knot the game at 2. Again, the Marlins’ lack of a left-hander in the bullpen came back to haunt them, as Drew’s blast came off right-handed reliever Bryan Morris. Mattingly had no recourse.

“I’ll take whatever we can get,” Baker said. “We helped them earlier, and they helped by not having a lefty later.”

In the eighth, Heisey also went deep as a pinch hitter — the third time he has done so this season. The Nationals have six pinch-hit home runs in 35 games; they had five all of last season.

Heisey’s shot gave Felipe Rivero and Jonathan Papelbon a comfortable cushion to navigate the ninth and close out the game.Papelbon’s 359th career save moved him to 10th place all-time.

“I don’t really play for personal accolades to see how far I can get,” Papelbon said. “I play because I love competing and I love coming to the park every day and I love the grind. I play for championships and my teammates and that’s it.”