Center fielder Denard Span acknowledges the crowd at Nationals Park after his hitting streak comes to an end at 29 games. (John McDonnell/The Washington Post)

In the middle of the first inning Thursday night, Bryce Harper and Jayson Werth pulled on their batting gloves and helmets together by the bat rack. In the Washington Nationals’ dugout, they gave one another the usual pump-up speech — “Come on, let’s get him, whatever,” Werth said later. Harper’s mind drifted to his home run total.

“I need one more for 20,” Harper said. “I want 20.”

“Play to win,” Werth replied, “and you’ll get everything you want.”

Werth would think back to that conversation minutes later as he rounded third. Harper’s laser into the front row over the right-center field fence provided the entirety of the Nationals’ scoring in a 3-2 victory over the Miami Marlins, which left them five games behind the Cincinnati Reds with nine to play. As Werth hit home plate, he turned around and saw Harper looking at him, grinning ear-to-ear.

“It made me smile, too,” Werth said. “It was just one of those things. We were just talking about this.”

The Post Sports Live crew tries to see meaning in the Nationals late season run even though the team is a long shot to make the playoffs. (Post Sports Live/The Washington Post)

Harper chuckled as he crossed home, a 20-year-old who could not conceal his happiness over a significant home run. Werth patted Harper on the head like a big brother as they walked back to the dugout.

Harper has endured much in his second major league season, playing through pain and ­mini-controversies. But lately he has been able to enjoy it, too. As Denard Span’s hitting streak ended and Gio Gonzalez went six innings on his 28th birthday for his 11th win, Harper went 3 for 4 and launched his 20th home run.

Harper became the second player with two 20-home run seasons at age 20 or younger. He joined Tony Conigliaro, whose age-20 season came in 1965. Harper’s milestone offered a reminder of just how special a player he can be.

“When you go through a period where you have all this attention and you try to live up to hype and you try to do things, you try to do too much,” Manager Davey Johnson said. “He’s getting over that. I think he’s back to enjoying the game, and that’s great to see.”

As Harper snared one small piece of history, another ended. Span went 0 for 4, snapping his hitting streak at 29 games, one more than halfway to Joe DiMaggio’s 56 and one shy of Ryan Zimmerman’s Nationals record. After Span struck out in the seventh, the sparse crowd at Nationals Park rose and showered him with cheers. Just before he reached the dugout, Span tipped his cap.

When the streak started Aug. 17, Span was hitting .258. As Thursday night ended, his average sat at .281. After the game, Span conducted an interview on the field. As he walked into the clubhouse, waiting teammates applauded.

“I’ve gotten a lot of scrutiny this year with how I started,” Span said. “And for me to do what I’ve done and give the fans an opportunity to see what I bring to the table, it’s just been good for them to see that I am a good player.”

Gonzalez allowed one run in the first on Ed Lucas’s RBI single. The Nationals responded in an eventful bottom of the first. With one out, Zimmerman singled and Werth walked, which brought Harper to the plate with two on. Henderson Alvarez backed Harper off with a 1-2, inside, 96-mph fastball and then tried to finish him off with a slider.

Harper smoked it to right-center field. The ball knifed through the cool air, landing in the first row above the Geico sign on the wall. The Nationals had taken a 3-1 lead.

“I’m excited about it,” Harper said. “We got a long ways to go. We got nine or 10 games left, and that’s what I’m focused on. Hopefully I can build off that.”

Harper’s season may have stalled after his magical first month, which ended with a crash into the right field wall at Turner Field. Then came the Dodger Stadium fence. He missed a month on the disabled list. An opposing pitcher threw at him. One of his own coaches questioned his hustle. A hip injury forced him to see another doctor.

“He’s a 20-year-old growing up,” shortstop Ian Desmond said. “We all got to do it in the minor leagues in the friendly confines of a stadium that holds 10,000 and has probably about 2,000 in it, where there wasn’t cameras in our faces. He obviously knows how talented he is, and he wants to be Mickey Mantle or whoever right now. Today. But we’ve all got to kind of earn our stripes. And everybody here is getting to witness him maturing.”

If Harper were to maintain his pace through the end of the season, his .892 on-base plus slugging percentage would finish among the top 10 in the National League. He is one of the league’s best hitters, and he is only 20. As the Nationals have won 11 of 13 and 22 of 27, he has smiled more often.

“I like to be in these situations,” Harper said. “I like playing in crucial situations where we need to play hard and play the game the right way and really be on point every night. I try to take baseball seriously of course, but you gotta have fun in those situations. I thrive off of playing in pressure situations.”

Alvarez was not nearly as thrilled about giving up the homer. He drilled Desmond, the next hitter, with a 3-0, 95-mph fastball. “He obviously intentionally hit him,” Johnson said. Home plate umpire Bill Welke warned both benches an intentional plunking would lead to an ejection. The Nationals went ballistic, and bench coach Randy Knorr got ejected for arguing that Alvarez should have been ejected.

Once the dust settled, Gonzalez and the Nationals’ bullpen held off the Marlins, culminating with Rafael Soriano’s 42nd save. Afterward, back in the clubhouse, Harper walked toward Werth, who was sitting at his locker. “What?” Werth asked.

Harper showed Werth a picture on his phone of them smiling at home plate. “I’m going to blow it up,” Harper said. Werth nodded as Harper walked away.

“Good player, man,” Werth said. “He’s young and impressionable, but he’s done a real good job. I’m proud of him.”