When you’re good, you’re good, and the Washington Capitals and Alex Ovechkin are darn good.

Behind three second-period goals by the three-time Hart Trophy winner and five-time Maurice Richard Trophy winner, Ovechkin propelled back into the NHL goal-scoring lead Thursday night by helping slay the Wild 4-3 at Xcel Energy Center.

The NHL-leading Capitals won their 40th game, while the Wild lost its seventh in a row overall, seventh in a row at home and 12th game out of the past 13. Washington has nine regulation losses in 53 games this season; the Wild has 10 since Jan. 10.

“Getting tired of it,” said Charlie Coyle, who scored the Wild’s first goal.

“Everything about this stinks,” said Ryan Suter, who scored the Wild’s second goal. “You usually have to hit rock bottom to go up, and I feel like we’ve hit rock bottom.”

“If this wasn’t really maddening and really frustrating, it would almost be comical the way things are going right now,” coach Mike Yeo said.

Every opponent in hockey knows he must keep two eyes on Ovechkin every time he hops the boards. Yet like all the great scorers, Ovechkin still has a knack of getting lost. Often when that happens, the puck finds his stick, and he’s always cocked and ready.

After a scoreless first period, Ovechkin scored three times — twice wide open at the back door — on nine shots in the middle frame.

The first one at the 2:14 mark: A deflected T.J. Oshie shot ricocheted right to him.

The second one 3:07 later: A wide John Carlson shot caromed off the end wall right to him for a water-bottle popper.

The third one 3:28 after Coyle scored: A puck bounced out of a pile right to him, and he went post, off Devan Dubnyk’s back, and in.

“Every single puck ends up on his tape and he doesn’t make a mistake,” said Dubnyk, 0-8-1 since Jan. 9. “That puck off the wall, I don’t think anybody else on the ice is putting that in the net.”

Ovechkin, who has 34 goals this season and 509 in his career, registered his 14th career hat trick and the 17th all-time against the Wild. All three goals were assisted by sidekick Nicklas Backstrom.

Ovechkin said a few weeks ago, his parents actually called and said, “It’s time for you to get a hat trick.”

The Wild felt the third one was questionable. Yeo challenged that, before Ovechkin’s goal, the puck came out of the zone — meaning the Caps were offside.

After a review, linesmen Jay Sharrers and Tim Nowak ruled good goal. Wild fans booed furiously because on the overhead big screen, it looked like the puck came out only to be put back in by Backstrom.

“I saw it in real life, and on the replay it looked even more offside,” Suter said. “[Sharrers] said he doesn’t have enough angles. He said he can’t overturn it because he can’t see it clearly. If they’re going to have the rule, they better get some more cameras, I think.”

Asked if the league needs better camera positions for offside challenges, Yeo said, “I don’t think I’m in a state of mind to start figuring out what’s best for the league right now.”

The game, as usual, was lost in the second period. Since the All-Star break, the Wild, which has allowed 21 goals in the past five games and at least four in six of the past seven, has been outscored 13-3 in five second periods, including three goals three times.

“I don’t think anyone can really put a finger on it, but we need to figure that out,” defenseman Matt Dumba said.