NEW YORK — The Washington Capitals jumped out to a two-goal lead Tuesday night and looked capable of operating like a well-oiled machine for the full 60 minutes. But then their third-period ghosts come back to haunt them again.

The New York Rangers scored four times in the third period to complete a run of five unanswered goals and claim a 5-2 victory at Madison Square Garden.

"Tonight I just thought we were inconsistent," Capitals Coach Peter Laviolette said. "We had guys that were not on the mark. Big mistakes. I thought we did fly-bys on too many pucks. We didn't compete hard enough on the pucks, turnovers, turned pucks over and big chances back in the different direction."

Washington's winning streak ended at three, but the Capitals (23-8-4, 50 points) still sit atop the East Division. Washington will face the New York Islanders, who are tied for second place with Pittsburgh with 48 points, twice during this five-game road trip — including in its next game Thursday night.

But Tuesday, the Capitals again were unable to put together a complete game, a lingering issue for this veteran team. The Rangers nearly completed a comeback from a 4-0 third-period deficit Sunday in Washington, but the Capitals held on for a 5-4 victory.

"We've just got to find a way to put 60 minutes together," defenseman Zdeno Chara said. "I think most of those games we didn't put 60 minutes together, even the games that we won. For example, the last game at home, we won the game, but I don't think we have had a full 60-minute game that we wanted to play. They took over in the third period."

After a sleepy second period produced no goals and kept Washington ahead by one, the third became a battle between Capitals rookie goalie Vitek Vanecek and Rangers counterpart Igor Shesterkin. Shesterkin (30 saves) emerged victorious; Vanecek (22 saves) couldn't make the key saves down the stretch.

The third period was all Rangers. Kaapo Kakko tied the score at 2 at 4:10 with a goal that capped a pretty passing sequence on the rush. Just over two minutes later, defenseman Adam Fox put the Rangers ahead with a nifty backhander for the eventual game-winner at 6:32. Artemi Panarin delivered an insurance goal with 4:19 left after he got behind the Capitals' defense and beat Vanecek on a breakaway. Pavel Buchnevich had an empty-netter at 19:25 to seal the win.

"We've got to find a way to be able to finish these games and play stronger defensively, making stronger plays and really taking a pride in our defense and be able to finish and find a way to win these games," Chara said.

Winger T.J. Oshie and fourth-line center Nic Dowd had put the Capitals ahead early. Oshie scored his ninth goal with a one-timer from the slot on the power play only 2:23 in. He was in discomfort on the bench late in the game after taking a cross-check, but Laviolette had no update on his status.

Dowd gave the Capitals a 2-0 lead by scoring his seventh goal in 35 games — matching his output from 56 games last season — by hammering home the puck during a scramble in front at 4:22.

New York got its first goal after a bad turnover by Capitals defenseman Dmitry Orlov at the left point in the Rangers' zone. Filip Chytil stole the puck and raced down the ice for a clean breakaway, putting it past Vanecek at 15:36 of the first.

Washington was lucky to escape the period without further damage. Panarin had two high-danger power-play chances, with one shot hitting the crossbar.

Capitals center Lars Eller returned to the lineup Tuesday after missing seven games with a lower-body injury he suffered March 13. Eller said Tuesday morning that he suffered a setback "in a different area" last week that stalled his return.

"I had a setback, plain and simple," he said. "As we progressed and I felt better and better, I just had a step backward and we had to settle down, rest again and then slowly progress one more time."

With Eller back, Laviolette scratched Richard Panik and kept Daniel Sprong in the lineup. Sprong was not a regular to start the season, but he suited up for his 24th game Tuesday; he has six goals and four assists. Sprong, acquired at the trade deadline last year for defenseman Christian Djoos, filled in when forward Tom Wilson was out of the lineup during his seven-game suspension and then kept his spot in the lineup with Eller's injury.

Tuesday was Panik's first time out of the lineup this season. He has three goals and six assists in 34 games, but Laviolette has applauded his defensive abilities as well as his physical play.

"It comes down to tough decisions," Laviolette said. "Richard was the odd man out today, and I think that when you are evaluating everything, you got to put yourself in a position to stay in the lineup."

More from The Post: