Price, the NHL's reigning MVP and Vezina Trophy winner, had missed eight games. He made 33 saves to help Montreal win for the second time in three games.
Despite two goals from Brock Nelson, New York fell to 10-7-3. The loss snapped the Islanders' two-game winning streak.
Travis Hamonic added a goal for New York.
Montreal won the first two games of the regular-season series against New York. The teams will meet Sunday in Montreal for the third and final time this season.
It didn't take long for the Canadiens to get comfortable in their first game at the Barclays Center - they led 3-1 at the first intermission.
Petry opened the scoring at 2:52 with his second of the season. After pinching down to the low slot, he found a rebound of Brian Flynn's shot that had ricocheted off the cross bar and tapped it in.
Nelson scored about 9 minutes later with his seventh of the season, and his fourth in four straight games, by shoving a rebound through Price. Canadiens coach Michel Therrien used his coach's challenge to have the goal reviewed, and the ruling on the ice was upheld.
The deadlock lasted just 35 seconds. Fleischmann put the Canadiens ahead with his sixth of the season on a shot from the right circle. The sequence began when Frans Nielsen committed a neutral-zone turnover, and then went to the bench as Montreal counterattacked.
Beaulieu increased the lead to 3-1 with 1:43 left in the period.
The Canadiens scored all three of their first-period goals on 11 shots and, in the process, chased Halak from the game. New York coach Jack Capuano replaced Jaroslav Halak with Thomas Griess before the start of the second period.
Halak finished with eight saves. Griess made 15.
New York sliced the deficit to 3-2 just 39 seconds into the second period on Hamonic's first goal of the season. But Petry's power-play goal at 14:49 restored Montreal's two-goal lead.
Nelson cut Montreal's lead to 4-3 with his second of the game 7:25 into the third period. Gallagher's empty-net goal with 19 seconds left in the game ended the scoring.
NOTES: This game was the first for Hamonic after it was revealed he had asked general manager Garth Snow to be traded. Following practice at the Islanders' Syosset, New York, training facility Thursday, Hamonic confirmed Sportsnet and TSN reports that he had requested a trade. "This is a personal family matter of mine that I hold dear to my heart," Hamonic said Thursday. "That's as far as I'm going to go." ... New York scratched Jean-Francois Berube, Adam Pelech and Taylor Beck. ... Torrey Mitchell and Jared Tinordi were Montreal's listed scratches. Therrien said Mitchell will not play this weekend as he is recovering from an injury. ... The announced attendance was 15,171.