Adam LaRoche is congratulated by his teammates after his three-run homer in the third inning of Washington’s win Tuesday night. (Greg Fiume/GETTY IMAGES)

Tuesday night, standing idly in the vicinity of the on-deck circle, Gio Gonzalez turned and started talking to his boss. Principal owner Mark Lerner leaned forward in his seat next to the Washington Nationals’ dugout, nodding, chatting with Gonzalez as pitches whistled to the plate. It was only the third inning on a sticky-hot night, and already Gonzalez’s teammates had afforded him a rare luxury. He could relax and tell a joke.

“I was telling him he needs to build an air vent behind the mound,” Gonzalez said.

For almost two months, the Nationals’ offense had stood more as an obstacle than a support for Gonzalez. In a 7-5 victory over the Arizona Diamondbacks, Gonzalez earned his first win since May 5 and Nationals hitters stopped treating him like he had once stolen their girlfriends. As Ryan Zimmerman rested his shoulder and Bryce Harper rehabbed in Potomac, the Nationals erupted for five runs in the third inning, three coming on Adam LaRoche’s opposite-field home run off right-hander Trevor Cahill.

The Nationals drove it home with a busted taillight and duct tape holding the bumper in place, but in the end the victory was theirs. After the Nationals took a 6-0 lead, the Diamondbacks scored in every inning from the sixth on. Miguel Montero roped an RBI, two-out single in the ninth off Rafael Soriano, who recovered amidst a hail of line drives for his 20th save.

“The bullpen has usually been pretty good,” Manager Davey Johnson said. “But they’re not used to having a big lead.”

The Washington Post’s Mike Wise, Dan Steinberg and Jonathan Forsythe discuss who the Wizards should choose for the third pick in NBA draft, Dan Haren’s struggles in the Nationals rotation and what people think of the Redskins name. (Post Sports Live)

The Nationals do not often score many runs, but when they do their pitching staff makes certain they do not go to rot. The Nationals have piled up at least five runs 30 times this season, and they are 28-2 in those games. They climbed back to .500 at 38-38 with an offensive outpouring, which again proved how easily defined the Nationals’ struggles are and how simple the solution can be: When they score, they win.

“To get up early like that, that’s really how our offense should operate,” said right fielder Jayson Werth, who went 2 for 2 with two walks. “We have a potent offense. We need to rally and score runs like that more often. If we’re going to be a championship club, that’s something that’s going to have to be night in, night out.”

Gonzalez (4-3) yielded two earned runs on nine hits over 61 / 3 innings. He watched Denard Span cut down a runner at home plate in the second inning, and in in the sixth he loaded the bases. But he dodged trouble and made crucial pitches when necessary.

And the Nationals finally afforded him a margin for error. In the eight starts between his last win and Tuesday night, Gonzalez had allowed more than two earned runs once, never more than four, and still stayed stuck on three wins. He never publicly complained; Tuesday night he could finally celebrate.

“For me, it’s keeping it cool, keeping it calm, keeping it right where I need to be,” Gonzalez said. “As soon as I start thinking, ‘I need more runs,’ it’s just going to take me off my path. It’s my job to go out there and pitch, don’t worry about the runs.”

After a few early pitches, Gonzalez seemed to flex his left knee, but he continued no worse for wear. “As soon as I pushed off, you wait to see if something happened,” Gonzalez said. “But it was nothing. It was more like tricking my mind that nothing happened.”

After breezing most of the night by a comfortable margin, the Nationals injected drama into the game in the seventh. Johnson pulled Gonzalez with one out. The crowd stood and roared, and Gonzalez tipped his cap.

“That was real important for him,” Span said. “Once we got out big, he started to settle in. He started getting ahead of hitters.”

Drew Storen jogged in from the bullpen. With two outs, a walk, a single and an error from second baseman Anthony Rendon pushed a run across. Storen worked a 3-2 count to Cody Ross, the tying run, then fired a 94-mph fastball. Ross swung, and something went flying out toward left field. Relief set in when it became obvious the object was Ross’s bat. The baseball rested harmlessly in Kurt Suzuki’s mitt.

The Nationals, for once, had built a big enough lead to absorb the scare. Playing two days after a groin strain knocked him out in the fourth inning, Werth ripped a double, scored two runs and drove in another. He trotted gingerly on the bases and in the outfield — the first batter of the game, Willie Bloomquist, reached on a double after Werth could not a reach a ball hit to the right-center field gap. At the plate, though, he produced.

“I don’t think he’s 100 percent,” Johnson said. “I worry about him all the time. It’s been that kind of year. He’s had a lot of little injuries. But we need him in there.”

The Nationals followed their usual pattern for the first two innings. They did not tally their first hit until Span — hitting .208 with a .260 on-base percentage and .278 slugging percentage in June — rolled an RBI single through the middle in the third inning. Werth singled behind him.

When LaRoche walked to the plate, he had not hit a home run in his past 86 plate appearances. It seemed certain the drought would grow to 87 when Cahill jumped ahead in the count, 0-2. Cahill hung an 80-mph changeup, and LaRoche smashed it to left-center field into the visitors’ bullpen.

“I’ve been getting some hits and throwing some good at-bats together, but not in position to really drive the ball,” LaRoche said. “Today, I felt better. I felt the timing was a little bit better. When I hit some home runs, they come in kind of bursts.”

“The tension in the clubhouse is because guys aren’t doing the things they’re capable of doing,” Johnson said. “If they’re doing the things they’re capable of doing, we have a really fun clubhouse. It’s just going to take a few hits.”

Late Tuesday night, Werth walked to the back of the Nationals’ clubhouse and settled into his locker. Span, sitting a couple stalls away, complimented him on the quality of his at-bats. Werth thanked him first, and then said, “Let’s get on a roll.”