WASHINGTON — The Philadelphia Phillies got a clutch home run to erase a three-run deficit and received a decent outing from a rookie pitcher who’s had trouble winning.

As the Phillies slide toward another losing season, they’ll take any positive they can get.

And so, after a 5-4 defeat at the hands of the Washington Nationals on Friday night, Philadelphia savored a few standout performances in a losing cause.

Manager Pete Mackanin liked the way rookie Jake Thompson looked while allowing two runs and five hits in 5 1/3 innings.

“Hate to lose, but I was real happy with Thompson,” Mackanin said.

The no-decision ended a five-start losing streak for Thompson, who came in with a 6.48 ERA.

There was the three-run homer by Cameron Rupp that brought the Phillies even at 4 in the eighth inning.

“That was a big homer for us,” Rupp said. “I sold myself out on getting a fastball there on a 2-0 count. I was ready for it.”

Unfortunately for the Phillies, all the good things that happened against the NL East-leading Nationals were negated when Washington rookie Trea Turner hit the game-winning home run off Frank Herrmann (0-2) with two outs in the ninth.

It was the first career multihomer game for Turner, whose two-run drive in the seventh put Washington up 4-1.

“He’s been really a game-changer for us. He got a pitch to hit and he took it yard,” Nationals starter Tanner Roark said. “He’s a gamer, a fighter. He’s perfect.”

Turner has eight home runs to go with 21 stolen bases in a mere 52 games this season.

“He’s doing something right up there,” Rupp said. “He’s getting on base and he runs like the wind and that helps. He’s a good ballplayer and he beat us tonight.”

Daniel Murphy scored two runs for the Nationals, who have won eight of 11.

Mark Melancon (2-1) worked the ninth for Washington.

Roark allowed one run, six hits and two walks over six innings. He left with a 2-1 lead, but will have to wait at least one more start to claim his career-high tying 15th victory.

Unfortunately for Roark, he’s seen the last of the Phillies. The right-hander is 3-0 with a 0.79 ERA in five starts against Philadelphia this season.

With the score tied at 1 in the sixth, Murphy doubled off Thompson and Bryce Harper ended a 3-for-16 slump with an RBI single to right.

Turner connected against Colton Murray for a three-run lead.

Earlier, two batters hit by pitches ended up scoring. Odubel Herrera came home on a single by Peter Bouros in the Philadelphia fourth before Anthony Rendon doubled in Murphy in the bottom half.

Herrera left in the fifth inning with a right leg contusion. After being hit by a fastball in his right knee, the outfielder had a difficult time walking to first base.

“They took X-rays. It’s no breakage or anything, but he’s day to day,” Mackanin said.

PLATOON SYSTEM

Mackanin intends to use Tommy Joseph at 1B more than 36-year-old Ryan Howard down the stretch — unless Howard continues to deliver big hits, such as his three-run homer Thursday night. “I’m a manager. I want to win games,” Mackanin said.

STREAKS AND STATS

Phillies: Howard’s single in the fourth inning gave him two straight games with hits for the first time since Aug. 21 and 24.

Nationals: It was the 16th game that Murphy has scored at least two runs. When he scores once, Washington is 44-21.

TRAINER’S ROOM

Phillies: 3B Maikel Franco missed a third straight game with a jammed right thumb. “I’m going to say he’s available to pinch hit,” Mackanin said.

Nationals: LHP Sammy Solis (left shoulder inflammation) “has sort of hit a roadblock,” manager Dusty Baker said. Solis has been on the DL since mid-August.

UP NEXT

Phillies: RHP Jerad Eickhoff (10-13, 3.86 ERA) starts Saturday night against Washington. He’s 4-1 in his last six starts.

Nationals: RHP Max Scherzer (16-7, 2.88) leads the big leagues with 243 strikeouts.