The Marlins made Stephen Strasburg work, but he ended up getting the win. (Eric Espada/Getty Images)

The Miami Marlins had Stephen Strasburg on the ropes again in the fifth inning Sunday afternoon, fouling off pitch after pitch, fighting finally to break the Washington Nationals right-hander. There were two on and two outs when Starlin Castro walked to the batter’s box at Marlins Park. Strasburg’s odometer read 99 pitches, and there was no relief in sight. The Nationals’ bullpen was shorthanded without a couple of relievers available. Strasburg needed to push through. The batter was his.

And so Strasburg emptied the tank. First came a 95-mph fastball for a called strike. Then a slider for a ball and a curveball Castro fouled off. Finally, the last gasp, a 97-mph fastball to catcher Pedro Severino’s mitt on the outside corner. Castro watched Strasburg’s 103rd and final pitch go by for strike three, and Strasburg jogged off the mound, his demanding day complete after five arduous scoreless innings in Washington’s 5-2 win.

“You get in those situations sometimes,” Strasburg said, “and you just kind of have to get back into it and just go mano y mano.”

He exited with a lead, and Washington’s offense, which collected eight extra-base hits, ensured it remained intact to cap a series sweep that moved the Nationals (29-22) to seven games over .500 for the first time this season and extended their winning streak against Miami to 11. Going back to April 29, the Nationals are an MLB-best 18-6, a stretch that has closed the gap between them and first place in the National League East from six games to one game.

Anthony Rendon broke the ice in the fourth inning when he smashed a solo home run to left-center field against right-hander Elieser Hernandez, just to the left of the ballpark’s sculpture. Strasburg made the lead stick, but it didn’t come easy. After a 1-2-3 first inning, the Marlins (19-33) made Strasburg grind for his outs, constantly fouling off pitches to escalate Strasburg’s pitch count. He was piling up the strikeouts — he had six through three innings — but needed 65 pitches to record nine outs as Miami posted four plate appearances of at least seven pitches.

“There was a lot of times and situations where I wanted to throw a putaway pitch,” Strasburg said, “and it was left in the zone and they were fouling it off.”

But the Marlins’ persistence didn’t produce any runs, while Strasburg helped himself in the fifth. Two batters after Wilmer Difo supplied a first-pitch leadoff triple, Strasburg knocked a groundball through the right side of a drawn-in infield for his third hit and first RBI this season to make it 2-0.

He then took the mound for the fifth inning with his pitch count at 78. An efficient frame would have given him enough leash to start the sixth, but the Marlins remained pesky. Lewis Brinson led off with a single. Two batters later, Derek Dietrich flied out to end his second nine-pitch at-bat of the day. J.T. Realmuto then worked a walk before Strasburg, bending but not breaking, struck Castro out looking to emerge unscathed. He finished with eight strikeouts to two walks as he extended his scoreless innings streak against the Marlins to 23.

After the escape, the Nationals capitalized on a meager Marlins bullpen. First, a struggling Bryce Harper, who had tallied seven strikeouts in the series before stepping to the plate in the sixth inning, unleashed his frustrations on an innocent baseball, slamming a pitch from left-hander Jarlin Garcia just inside the right field foul pole onto the concourse. The home run was Harper’s NL-leading 16th. He later added a sacrifice fly but struck out looking in his final at-bat. The former MVP is batting .232 with a .916 on-base-plus-slugging percentage.

“I’m not really too frustrated because we’re winning ballgames,” Harper said. “If I hit .230 and I hit 40 [home runs], I’ll take it any day of the week. So I just got to keep taking good swings and get some stuff over the white thing. If I can do that, we’ll be okay.”

The Nationals constructed a 5-0 cushion for a bullpen that didn’t have closer Sean Doolittle available because of his workload the previous two days on top of having Ryan Madson on the disabled list. Without them, Justin Miller, Wander Suero, Sammy Solis and Brandon Kintzler combined to allow two runs over four innings.

“It’s really good when you look at your lineup card in [a] game in progress and you could put these guys in certain situations and feel real confident,” Nationals Manager Dave Martinez said. “It gives us length in the bullpen, and every one of those guys today I felt confident in them.”

What the Nationals accomplished this weekend won’t draw acclaim. The Marlins are the Marlins, an overachieving last-place club expected to languish this season. But context is necessary, and it illustrates a shift. The Nationals, it seems, are coming together. Daniel Murphy and Brian Goodwin have begun rehab assignments. Madson could come off the disabled list this week. The first base platoon of Matt Adams and Mark Reynolds has more than compensated for the injured Ryan Zimmerman. The bullpen is the deepest it has been all year, and the starting rotation remains as good as any in baseball.

Most importantly, they are taking care of business, beating teams they are supposed to beat to make up ground in the standings. After taking five of six from the San Diego Padres and Marlins, another inferior team awaits up the Beltway on Monday in Baltimore. The Nationals said they would be fine all along, that it was too early to panic in April and May. But they’re finally surging. Confidence is brimming. They just might be righting the ship.