New York Rangers center Mika Zibanejad (93) celebrates with center...

New York Rangers center Mika Zibanejad (93) celebrates with center Vincent Trocheck (16) after scoring a goal against the Anaheim Ducks on Oct. 17, 2022. Credit: Noah K. Murray

Lesson No. 1 for any and all rebuilding teams coming into Madison Square Garden to face the Rangers this season: Stay out of the penalty box.

The Anaheim Ducks gave the Rangers four power plays in their visit to the Garden on Monday. The Blueshirts punished them by scoring three power-play goals, two by Mika Zibanejad, on the way to a 6-4 victory that lifted the Blueshirts’ record to 3-1.

Vincent Trocheck had the other power-play goal and Artemi Panarin assisted on all three extra-man goals. The Rangers are 5-for-15 (33.3%) when a man up this season.

“The way they snap that puck around and they find the open guy . . . they’ve just got so much skill and talent that they make those plays happen,’’ coach Gerard Gallant said. “You can’t fault the goalies on any of those goals. They’re just terrific plays and great shots.’’

Zibanejad (two goals, two assists) and Panarin (one goal, three assists) led the way for the Rangers against the Ducks, who had lost to the Islanders, 7-1, on Saturday. Panarin, Kaapo Kakko and Alexis Lafreniere had the even-strength goals.

Gallant didn’t even seem all that annoyed by the fact that the Rangers allowed two late goals that made the final score a lot closer than the game actually was.

The Rangers outshot Anaheim 43-22, but goals in the third period by Max Comtois and Derek Grant kept the Ducks (1-2) in it until the end.

“I thought we played great, but I thought we got lackadaisical on the two goals in the third period,’’ Gallant said. “And that’s frustrating, because you can’t do that.’’

Defenseman Braden Schneider said: “We were making softer plays and not getting pucks deep when we should have. We needed to finish the game the right way. And unfortunately, it does sting a little bit more when you give up four goals.’’

Anaheim’s Mason McTavish took the game’s first penalty, a delay of game for shooting the puck over the glass, and the Rangers capitalized when Zibanejad sent a diagonal pass through a maze of bodies to Trocheck, who tapped the puck into the yawning back side of the net behind goalie John Gibson at 7:34 of the first period.

A hooking call against Grant gave the Rangers their second power play, and this time it was Trocheck who fed Zibanejad for his first goal, putting the Rangers up 2-0 at 13:10.

Former Ranger Frank Vatrano got Anaheim on the board when he whipped a shot from the left wing over Igor Shesterkin’s glove for his second goal of the season at 15:48. Trevor Zegras tied the score at 2-2 on a three-on-two rush at 1:34 of the second period.

Kakko untied it at 9:34, getting the shaft of his stick on a shot from Zibanejad to put the Rangers up 3-2.

That goal, and another Anaheim penalty, opened some separation on the scoresheet for the Rangers.

Kevin Shattenkirk, a New Rochelle native and former Ranger, was penalized for tripping Sammy Blais, who was making his season debut after missing the first three games with an upper-body injury.

Twenty-two seconds after the power play expired, Lafreniere banged home a feed from Filip Chytil to make it 4-2 at 17:39.

Just before the period ended, Rangers defenseman Ryan Lindgren intercepted a stretch pass by Anaheim’s John Klingberg and passed to Adam Fox (three assists), who relayed it to Panarin, who scored on a wrist shot with 34 seconds left to give the Rangers a 5-2 lead.

Comtois’ goal at 5:33 of the third made it 5-3, but Zibanejad’s second goal pushed it to 6-3. Grant scored with 3:46 left to make it 6-4.

More Rangers