Gerardo Parra blasts a first-inning double Thursday, one of his three hits in a 7-6 win over the Mets at Nationals Park. (John McDonnell/The Washington Post)

The Washington Nationals weren’t supposed to need a hero Thursday afternoon. They amassed a four-run lead in the first inning and settled in behind Aníbal Sánchez, who retired the first four New York Mets he faced. Then things went sideways — Sánchez left early with an injury, and the bullpen blew up late.

The hero wasn’t supposed to be Gerardo Parra. The Nationals have one of baseball’s worst offenses, and the 32-year-old was released last week by the San Francisco Giants, who have one of baseball’s other worst offenses, after hitting .198 in 97 plate appearances. Yet for the third time in the seven days since the Nationals signed him, the difference at the plate was Parra, this time in a 7-6 Nationals win.

In the fifth inning, the veteran blasted a 96-mph fastball from Mets starter Zack Wheeler into the Nationals’ bullpen, a two-run homer that broke a 4-4 tie. Two innings later, he drew a two-out walk, stole second and scored the Nationals’ seventh run when Kurt Suzuki singled to right.

“That’s a big one in that moment,” Parra said of the steal. “The first base coach [Tim Bogar], he’s a good guy. He knows a lot that I steal bases, and he gave me a chance, and I got it.”

The insurance run loomed large when the Mets rallied with four hits and two runs against closer Sean Doolittle in the ninth. But Doolittle got Mets outfielder Keon Broxton to swing through a high fastball with the bases loaded to end it.

Parra hasn’t revolutionized his approach at the plate in Washington — he entered the game hitting .143 in 15 plate appearances with the Nationals — but he went 3 for 3 Thursday with the walk, and almost all of his hits have come in crucial situations. Parra’s five hits since joining the team: a game-winning grand slam Saturday, a no-hit-bid-shattering double in the eighth Sunday and a rally-sustaining double in the first, a single and the crucial home run Thursday against the Mets (20-22).

The injury-riddled Nationals are slowly healing, and Manager Dave Martinez said Parra’s position in the lineup was as important as his presence.

“When you can lengthen your lineup and have two veteran guys that swing the bat fairly well, it helps down there [at the bottom of the order],” Martinez said. “I thought it was key for us today, being able to stretch out long innings and keep them going.”

The victory left the Nationals at 18-25, six games behind the first-place Philadelphia Phillies in the National League East, and secured their first series victory since April 16-18, when they beat Parra’s old club. After looking overmatched Tuesday in a series-opening 6-2 loss, the Nationals rebounded Wednesday in a 5-1 win and carried the momentum into Thursday. Martinez downplayed the importance of winning a series, because he wants the team to focus on one game at a time.

“Going into today, we’re 1-0,” Martinez said. “Every series you play, you want to come out with a winning series. I tell the boys, ‘Just go out there and play.’ ”

The prospect of a series win looked daunting at first. Wheeler entered the game sizzling with a 2.93 ERA and 49 strikeouts over his previous 40 innings (six starts). Yet the Nationals jumped on him in the first, turning three singles, two doubles and a walk into four runs.

In the second, Sánchez grimaced in pain after issuing a one-out walk to center fielder Brandon Nimmo. During the eight-pitch at-bat, Sánchez had thrown over to first base and felt a twist in his left hamstring, an injury that has troubled the veteran starter in the past. His landing leg felt compromised.

“I couldn’t stop my body to home plate,” Sánchez said. “That’s why I [threw] a few balls after that.”

After the final pitch of the at-bat, Sánchez walked off the mound and yelled into his glove. Though Sánchez will get an MRI exam Friday, he considers the injury “not serious.” Martinez expects the left hamstring soreness will land Sánchez on the injured list and force him to miss his next start.

Enter Erick Fedde, the starter the Nationals turned into a reliever last week. The right-hander got Mets shortstop Amed Rosario to ground to counterpart Wilmer Difo for what looked like a tailor-made double play. But Difo mishandled the grounder, stepped on second base himself and made a wide throw to first. The Nationals once again prolonged an inning and put themselves in trouble with poor defense.

Yet Fedde escaped, striking out catcher Tomas Nido to get out of the inning. It was the latest performance in a stretch that had become Fedde’s best at the major league level.

The next inning, it fell apart. Fedde allowed leadoff singles to Wheeler and Jeff McNeil. Robinson Cano laced a ground-rule double to left-center, scoring Wheeler. Then right fielder Michael Conforto erased his starter’s struggles by depositing the first pitch he saw from Fedde, a 93-mph sinker up and in, into the Nationals’ bullpen in right field. The three-run homer tied the game at 4.

Despite that mistake — the sinker running too far back in over the plate — Martinez thought Fedde pitched well and showed further development in his new role.

“I told him today when he came out of the game, ‘I know you gave up a few runs, but you threw the ball really well, so just keep it going,’ ” Martinez said.

Wheeler settled in himself, retiring 10 of the next 13 Nationals hitters after the first. Fedde and the procession of one-inning relievers behind him locked in, too. Yet where Wheeler faltered, allowing the homer to Parra, the Nationals did not. Following the Conforto home run, they set down 17 of the next 19 Mets hitters.

Then came the ninth. Doolittle created a mess of his own but worked out of it for his seventh save.

“When he goes out there, it’s his to win or lose,” Martinez said of Doolittle. “He battled through it and he got a big out for us.”