The Rangers wanted points in their final game before the All-Star break. The Flyers, scrapping for a wild-card spot with the Maple Leafs and other teams, needed points.

In a goaltenders’ battle, dominated by Philadelphia’s Steve Mason, who made 34 saves, special teams decided the match at Madison Square Garden on Wednesday night.

The Rangers failed on two power plays in the second period and one in the third, and the Flyers cashed in on their first and only man advantage early in the third period and then later at even-strength for a 2-0 victory that snapped the Blueshirts’ three-game winning streak.

It was scoreless in the third when Mats Zuccarello hit the post from between the circles early — the third time the Blueshirts had rung iron on the evening — but Matt Puempel tripped Michael Raffl at 5:35, and the first power play for the Flyers clicked.

Henrik Lundqvist made one of his 23 saves but the Rangers couldn’t clear in front and Wayne Simmonds backhanded the loose puck in at 6:09. It was the first man-advantage goal for the Flyers in 15 chances.

Claude Giroux got his stick caught in Chris Kreider’s skate at 7:14, but the Blueshirts flubbed their third power play and sank to 0-for-14. The dagger came on a bouncer when Jakub Voracek drove the net and the puck glanced off Michael Grabner’s skate, rolled through Kevin Klein near the net, kissed the post and trickled in at 9:45.

advertisement | advertise on newsday

The Rangers, who had won six straight against the Flyers, couldn’t recover and were blanked for just the second time this season. The other was a 2-0 loss to Ottawa on Nov. 27.

In the first period, Mason stopped all 16 shots from the Rangers, who controlled the play. The three most dangerous shots came from Grabner, on a breakaway at 7:25 which Mason appeared to get a piece of with his glove before it hit the crossbar, and then he stopped Grabner twice more with just over a minute left, including a snap shot and a backhanded follow from about 10 feet away.

Mason also slid to his left to deny Rick Nash’s one-timer from one knee at the right circle on a cross-ice pass from Pavel Buchnevich, although Nash didn’t get all of it.

Defensively, the Rangers (31-17-1 but only 14-10-1 at home) were effective. The Flyers had just four shots in the first 17 minutes, and when the Flyers had a 2 on 1, Klein raced back to knock Sean Couturier off the puck with 5:31 left. Lundqvist stopped Brayden Schenn and Travis Konecky late in the period, and finished with eight saves.

It was the second time in three games that the Rangers were in a scoreless game going into the third period. On Sunday at Detroit, no one scored until J. T. Miller in overtime.

The Rangers game fell off a little in the second period that included two failed power plays.

Mason was lucky on his only gaffe of the period. Zuccarello’s low shot from the left boards went through his legs at the near post and off the far post and away.

Mason did get his right arm on a Nash try after a flip pass from Mika Zibanejad at 8:57, then Nash shot wide. Lundqvist was there for Raffl’s spinaround at 12:40, but couldn’t keep the Flyers off the board in the third.