Ryan Zimmerman, far right, and Rafael Soriano celebrate with their teammates after defeating the Colorado Rockies. (Doug Pensinger/GETTY IMAGES)

The process of piecing this erratic Washington Nationals season back together may have begun in earnest here Thursday afternoon. Left-hander Ross Detwiler started a game for the first time in 29 days, with a nagging muscle strain in his side finally behind him. Stephen Strasburg’s return is just days away, meaning the formidable rotation that was the basis for the season’s high expectations will be reconstituted.

In a 5-4 win that gave the Nationals two of three in the three-game series against the Colorado Rockies, Detwiler, back from an oblique strain, tossed 77 pitches and surrendered three runs over five innings. But, for a change, the Nationals’ offense rescued the pitching staff and scored three runs after the sixth inning, overcoming a 3-2 deficit. Ian Desmond continued his torrid hitting with four hits, Ryan Zimmerman delivered three RBI and the Nationals were the rare beneficiaries of back-to-back balks that provided a crucial run in the seventh inning that tied the game.

The Nationals (33-32) moved back above .500 for the first time since May 29 and won their first road series since they took a three-game series at Pittsburgh on May 5. The Nationals had been treading water for 10 weeks, but after two straight wins they are only 51 / 2 games behind the idle Atlanta Braves in the National League East. A week ago, the Nationals sat a season-high eight games back. Now, they have won four of five for the first time in a month.

In addition to the balks, the Nationals were aided by the fact the Rockies lost three key players to injury — Troy Tulowitzki (broken rib), Carlos Gonzalez (foot) and Dexter Fowler (hand) — over the course of the game.

“I hate to say it, but the breaks went our way,” reliever Craig Stammen said. “Two balks. Their best players all got hurt. That’s kind of how last year went. It seemed like everything went our way, so [Thursday] was like the first day all season I felt like things went our way.”

The Post Sports Live crew discusses the possibilities of why Bryce Harper had a brace on his knee after seeing Dr. James Andrews on Monday. (Post Sports Live)

Other than Zimmerman’s two-run homer in the third inning, the Nationals’ offense looked meager early against left-handed starter Jeff Francis, who entered with a 6.30 ERA. The Rockies took a 3-2 lead in the fourth, aided by right fielder Jayson Werth’s error on a double by Michael Cuddyer. Detwiler bounced back for a 1-2-3 fifth, his final inning.

“There’s always a little hesitation there, but I was just trying to go out there and attack as much as I could,” Detwiler said. “We got through the first one. Hopefully we can relax and get back to the form I was in before.”

The Nationals tied the game in curious fashion in the seventh. And, unsurprisingly, Desmond was at the heart of the action. He singled to start the inning off right-hander Wilton Lopez and stole second base. There, with two outs, the craziness started with Steve Lombardozzi batting.

Desmond took a lead off second, and then Lopez was called for a balk by home plate umpire James Hoye and second base umpire Bob Davidson. Lopez looked puzzled, and Desmond jogged to third. With a 2-1 count, Lopez was called for a second balk by third base umpire Jim Reynolds, and Desmond jogged home to tie the game at 3. The crowd at Coors Field erupted in a chorus of boos.

“If you’re going to call it once, you’ve gotta call it twice,” Desmond said. “You gotta keep on calling it. It’s consistency. They did a good job. That’s what we expect.”

As Lopez stood with his back foot on the rubber, he flinched his right arm as it hung loose. The slight move looked as if Lopez was going to reach into his glove hand before throwing, but he stopped both times. Nationals Manager Davey Johnson said he actually spotted Lopez make that movement three times, though it was called only twice.

“Umpires aren’t going to call something like that to tie up a game unless it’s obvious,” Zimmerman said.

Lopez and Rockies pitching coach Jim Wright were later ejected. Lopez was tossed for yelling at first base umpire John Hirschbeck as he ran off the field following the inning. Hirschbeck, the crew chief, told a pool reporter that Wright was ejected for making the hand gesture for crazy from the top step of the dugout.

An inning later, the balks were rendered moot. Pinch hitter Roger Bernadina doubled, and Zimmerman crushed a double to right field to score him and give the Nationals a 4-3 lead. Desmond, 23 for his past 57 during his 15-game hitting streak, delivered a clutch single up the middle for a precious insurance run that grew in importance when Rafael Soriano yielded a run in the ninth.

The late offensive outburst overcame the Nats’ ongoing struggles against left-handers, even mediocre ones. Entering Thursday, the Nationals were batting just .209 against left-handers, the worst mark in the majors. Francis, working with an array of off-speed pitches and sinkers, held the Nationals to two runs on five hits over six innings, while striking out eight.

Stammen pitched two scoreless innings of relief for Detwiler, working around two base runners in the seventh. Xavier Cedeno and Drew Storen combined to toss a perfect eighth inning. Soriano pitched a rocky ninth for his 17th save.

If the Nationals hope to stay above a .500 record, a healthy starting rotation will be part of the solution. The Nationals were built on the strength of their starters, and losing two key pieces for at least the past two weeks has had ripple effects on the rest of the roster. The return of Detwiler — and soon Strasburg — will boost a rotation that has the fifth-best ERA in the majors at 3.45.

“That’s a huge part of our team,” Stammen said. “The strength of our team is our starting pitching, and getting those two guys back here shortly it’s going to only improve.”