Gio Gonzalez looked like the No. 3 starter the Nationals need him to be, but Washington still lost. (Justin K. Aller/Getty Images)

Gio Gonzalez did not agonize over his mild mistake Wednesday afternoon, the one that Starling Marte launched over the wall in center field and ultimately cost the Washington Nationals in a 2-0 loss to the Pittsburgh Pirates at PNC Park. He was upbeat in the muted visitors’ clubhouse as his teammates showered and dressed for their final trip before the all-star break. He had assembled his best start since early June, allowing two runs — both on Marte’s blast in the third inning — across six frames Wednesday. It was encouraging progress for a man who had looked lost for a month.

But the Nationals have reached a point where an individual performance, encouraging as Gonzalez’s seemed, does not override team results. They must start stacking wins as the first half dwindles, and they didn’t Wednesday because their puzzling boom-or-bust offense — the same unit that has scored 14, 17 and 18 runs in games over the past two weeks — was shut out for the ninth time since June 1.

The Nationals (46-46) spent the afternoon failing to generate runs when given chances and ultimately wasting a quality outing from Gonzalez as they sank back to .500. They will begin a four-game set Thursday against the New York Mets, another toiling club, and will close out the first half without back-to-back series victories since the end of May.

“Consistency is the name of the game,” Nationals Manager Dave Martinez said. “You just got to be consistent. We’ve seen a lot. One day we hit and score a lot, and one day we don’t. So we just got to get consistent.”

The Nationals had opportunities to score early against Pirates right-hander Trevor Williams. They left two runners on base in the first before Gonzalez was left stranded after his leadoff double in the third. The pitcher watched the top of the Nationals’ order — Adam Eaton, Juan Soto and Anthony Rendon — fail to move him up a base.

“You think you’re going score a run,” Martinez said. “You got the right guys up there. Just didn’t happen today.”

Two runners were stranded the next inning before Washington finally recorded its first hit with a runner in scoring position in the fifth when Rendon singled to left field, but the line drive was hit too hard and too shallow to score Eaton from second base. Bryce Harper, who struck out four times Tuesday, followed with a strikeout to end the inning with runners on the corners. Through five innings, Washington was 1 for 7 with runners in scoring position and had left seven on base. The Nationals left an eighth runner on base in the seventh as the Pirates’ bullpen mowed through their lineup.

“It is a little frustrating,” Nationals catcher Matt Wieters said. “But we have an offense that can put up four or five runs a game and rely on our starting pitching like Gio did today.”

Meanwhile, Gonzalez did not resemble the beleaguered pitcher who took the ball every five days over the previous month — the one with an 8.14 ERA in his past six starts. He was as efficient as he has ever been through the first two innings, needing just 18 pitches to get six outs.

He couldn’t, however, survive his first predicament unscathed. It began with Gonzalez surrendering a leadoff double to Jordy Mercer in the third before getting two outs to bring up Marte. The Nationals could have decided to walk Marte, the Pirates’ most dangerous offensive threat and a right-handed hitter, with first base open. Gregory Polanco, an inferior left-handed hitter, was on deck. On paper, Polanco was the better matchup for the left-handed Gonzalez.

The Nationals instead decided to pitch around Marte. The duel began with Wieters calling for three straight fastballs because he figured Marte was hunting for something soft. The catcher hoped Marte would engage enough on the fastball to have his guard down against a change-up. So Wieters called for one. It wasn’t an egregious gaffe — the pitch was thrown over the inner half but down around the knees — but Gonzalez threw it firmer than he would have liked. Marte didn’t miss the 86-mph offering and gave Pittsburgh (43-49) the lead.

“It was one pitch. Obviously, if you can take it back, it’d be great, but it was still a pitch down at the bottom [of the strike zone],” Gonzalez said. “If he lets it go, it’s a strike.”

Gonzalez completed his outing with three scoreless innings after the homer. He turned his left ankle jumping for a chopper hit over his head in the sixth, which hobbled him enough to warrant a visit from Martinez and trainer Paul Lessard, but stayed in the game to complete his outing — and his first half — by striking out Josh Bell with his 89th pitch. Working with Wieters, a stabilizing presence behind the plate, for the first time in two months, Gonzalez allowed the two runs on six hits. He walked one and struck out four. It was the first time he logged more than five innings since June 15.

“That’s huge for me,” Gonzalez said. “That’s a great, great start for me in the right direction.”

But it came in a loss in a game the Nationals expect to win against a team constructed to tank this season. A week ago, the Nationals had convened for a closed-door, players-only meeting they hoped would galvanize them. They proceeded to win three straight games against the Miami Marlins, appearing perhaps to turn their season around. But they have lost three of four since. That momentum has evaporated, and it will take more than a promising individual performance to generate some more.