WASHINGTON — Lane Thomas singled in the go-ahead run in the eighth inning and the Washington Nationals sent the Philadelphia Phillies to their fifth straight loss, winning 8-7 after blowing a six-run lead.

The defending NL champion Phillies have just five victories in their last 18 games and are tied with the Nationals at the bottom of the NL East at 25-32.

“We’ve got to overcome it,” Phillies manager Rob Thomson said. “We’ve got to play better, get consistent in all phases and keep moving forward.”

Alex Call drew a two-out walk against Connor Brogdon (2-1) in the eighth, stole second on a pitch catcher JT Realmuto couldn’t handle and scored on Thomas’ single to right center.

The Baltimore Banner thanks its sponsors. Become one.

“The way Lane’s swinging the bat, if you can get on second base, we can win the game,” Call said. “I look over and the ball’s in the dirt, he doesn’t catch it. Now I’m saying: ‘All right, Lane. Come on!’”

Kyle Finnegan (3-2) pitched 1 2/3 innings for the victory, stranding the tying run on second in the ninth.

Nick Castellanos homered twice, singled, doubled and drove in five runs for Philadelphia, which had scored just three runs in its past three games.

“There’s definitely a lot of positives as a group,” Castellanos said. “Showing some fight. It would have been really, really easy to lay down and allow the way the game started to be the way that it finished.”

Down 7-1 after four innings, Philadelphia tied it at 7 in the eighth. Brandon Marsh worked a nine-pitch walk against Mason Thompson leading off, and Drew Ellis singled with one out. Finnegan came on to face Kyle Schwarber, who hit a ground ball up the middle. Shortstop CJ Abrams fielded it behind second base, touched second for one out but threw wildly to first and Marsh came home with the tying run.

The Baltimore Banner thanks its sponsors. Become one.

Castellanos’s second homer, a two-run shot to center in the sixth, pulled the Phillies to 7-3 and Marsh added an RBI single in the inning.

In the seventh, Schwarber doubled with one out and Bryson Scott reached on an infield single. Hunter Harvey came on and walked Bryce Harper to load the bases. Castellanos singled to center, scoring two runs to make it 7-6.

Luis Garcia homered and Jeimer Candelario doubled twice and drove in three runs for the Nationals, who have won seven of 12.

Philadelphia starter Zack Wheeler, coming off eight shutout innings against Atlanta, allowed seven runs on eight hits in 3 2/3 innings.

“This one’s on me really,” Wheeler said. “Guys battled back. Just couldn’t finish it out. We know who we have in this room and what we’ve got to do.”

The Baltimore Banner thanks its sponsors. Become one.

Josiah Gray gave up four runs on six hits in 5 1/3 innings for Washington.

Candelario doubled just beyond the reach of left fielder Schwarber to drive in the first of Washington’s two runs in the first.

In the second, Abrams hit a one-out drive to deep center that Marsh misplayed into a double. With two outs and two on, Candelario doubled off the wall in right center to make it 5-0.

Garcia ended Wheeler’s night with a solo homer in the fourth.

“When you come out the way we did, you’ve got to tack on,” Nationals manager Dave Martinez said. “It didn’t happen tonight, but we got one more than the other guys.”