Philadelphia’s Gabriel Gomez, right, gets the jump on D.C. United’s Branko Boskovic, but United took the match — and the crucial two points that came with it. (Drew Hallowell/Getty Images)

D.C. United had not won on the road in three months and hadn’t scored away from RFK Stadium in more than 300 minutes of play.

The way Thursday night’s critical match against the Philadelphia Union was unfolding, a breakthrough didn’t seem promising.

But with a scoreless game crawling into the second half and the attack unable to unlock Philadelphia’s defense, Coach Ben Olsen made a substitution that, for the second consecutive outing, altered the outcome and bolstered United’s playoff chances.

Ten minutes after entering, Maicon Santos delivered a long ball that ultimately led to Lionard Pajoy’s 67th-minute goal for a 1-0 triumph before 16,024 at PPL Park.

Given its travel doldrums — six straight defeats, by a 14-3 margin — United (14-10-5, 47 points) would have been content with a point on the road. Instead, it collected three to overtake the Houston Dynamo (46) and Columbus Crew (45) and move into fourth place in MLS’s Eastern Conference.

Five clubs will advance to the playoffs. Most contenders in the conference have five matches remaining.

Philadelphia (7-14-6) is winless in eight straight. United had not won on the road since beating the Union in mid-June.

“No excuses: We’ve been pretty poor on the road,” midfielder Lewis Neal said. “To get a victory, it’s a massive result.”

The second half followed an eerily similar pattern to Saturday’s 2-1 home victory over the New England Revolution: Olsen substituted Branko Boskovic shortly after intermission; the replacement played a part in the go-ahead goal; and the opposition made a furious but failed push for an late equalizer.

“I’ve made a lot more substitutions that haven’t made impacts,” Olsen said with typical self-deprecation. “If you add ‘em all up, I’m sure I’m in the negative.”

Like Saturday, though, when Neal scored his first goal of the year seven minutes after replacing Boskovic, Olsen’s move Thursday paid off.

Known for his scoring prowess more than his passing touch, Santos collected the ball in his own end and, instead of playing it directly forward, targeted Chris Pontius making a run on the right side.

“Everybody was looking to the left side,” Santos said. “I wanted to do something different, something they didn’t expect. It worked.”

The left-footed delivery might’ve taken a slight deflection but ended up traveling about 45 yards, splitting two defenders and curling into Pontius’s path at the top of the box.

Pontius beat defender Gabriel Farfan on the dribble, drawing out goalkeeper Zac MacMath.

Pontius crossed to Pajoy, who settled the ball with his chest, let it bounce and then side-volleyed a 12-yard shot against his former team to snap United’s goalless streak on the road at 314 minutes.

“I saw [Santos] pick his head up and then I timed my run off of it,” Pontius said. “It was an unbelievable ball.”

Pajoy, a Colombian forward, was making his first appearance in Chester since being acquired from the Union for midfielder Danny Cruz last month.

He began the match as United’s lone forward, stationed in front of Boskovic, who moved the ball well in the first half but wasn’t able to provide the killer pass to change the game.

When Boskovic departed, Santos joined Pajoy at forward and Neal inherited distribution duties after serving in a deep role alongside Perry Kitchen.

“He was great,” Olsen said of Neal. “He is a smart player, not only on the ball and making the right decision, but he is also a voice out there.”

United’s lead endured several anxious moments.

Philadelphia launched dangerous balls into the box but was unable to stab a shot past Bill Hamid, who made five second-half saves to record his sixth shutout.

“It wasn’t the greatest performance, but we hung in there,” Olsen said. “That’s what you’ve got to do nowadays.”

United, which hasn’t qualified for postseason since 2007, will host Chivas USA (7-14-7) on Sunday evening.