Finally, the pieces fell into place for the Devils.

Goalie Cory Schneider posted his first shutout for his new team and the Devils recorded their first victory of the season, 4-0, over an erratic Henrik Lundqvist and the rival Rangers tonight at Prudential Center.

The victory ended the Devils’ longest winless streak at the start of a season (seven games) and moved them ahead of the Rangers in the Metropolitan Division with a 1-4-3 record. The Rangers are 2-5-0.

It was Schneider’s 10th career shutout, coming in his 102nd NHL game.

A sellout crowd announced at 16,592 saw Andrei Loktrionov, Adam Henrique, Michael Ryder and Dainius Zubrus score goals. Jaromir Jagr and Marek Zidlicky each had a pair of assists.

The Rangers played without captain Ryan Callahan (broken thumb), Rick Nash (concussion) and Carl Hagelin (shoulder).

Already missing Patrik Elias with the flu and Damien Brunner with upper body soreness that could be a shoulder injury, the Devils knew for certain their luck was changing when captain Bryce Salvador avoided a serious injury when he crashed head-first into the corner boards with 26.4 seconds remaining in the second period.

Rangers winger Benoit Pouliot checked Salvador in the right circle and the Devils defenseman slid on his back hard into the right corner boards. Salvador, who hit his head on the boards and then the ice, tried to get up several times but was unable.

Clearly dazed, he was helped to the dressing room by teammates Anton Volchenkov and Stephen Gionta.

Salvador, who missed the entire 2010-11 season with a cochlear concussion, did not come out for the start of the second period but returned to the ice at the halfway point of the period and assisted on the goal that gave the Devils a 4-0 lead.

Lundqvist stopped a slapper from Salvador but Zubrus scored on the rebound at 14:32 for his second goal of the season.

The Devils had opened the scoring at 7:22 of the first period on a goal by Andrei Loktionov. Pouliot was called for high-sticking Volchenkov at 4:11 of the opening period, and though the Rangers killed off the penalty, but Loktionov scored his first goal of the season on the rebound of a shot by Volchenkov, who played the puck off the left wing boards and fired a shot on goal. Loktionov popped in the rebound from the bottom of the left circle.

It was a 2-0 Devils lead after Schneider made a stop on Pouliot’s shot from the left circle at 12:14 of the first and the Devils turned the play up ice.

Adam Henrique took a pass from Jagr and outraced the Rangers’ defense before firing a slap shot from the middle of the left circle. His shot beat Lundqvist on his stick side at 12:37. Rostislav Olesz and Jagr had the assists.

Steve Bernier took a shot in or near the face during the first period and went to the dressing room, but he was back for the start of the second.

The Devils extended their lead early in the second on a power play goal that came after Rangers center Dominic Moore was sent off at 5:42 of the second for a faceoff violation when he used his hand to push the puck.

Michael Ryder took a feed from Jagr and fired a slapper past Lundqvist at 6:00 for a power play goal. It was Ryder’s third goal of the season and first on the power play.