Nick Suzuki and Brendan Gallagher scored in regulation for the Canadiens, who have won six of their last eight games. Carey Price made 35 saves and improved to 4-7-1 in his career against Anaheim.
''A win's a win,'' Petry said. ''Obviously we want to play the right way and there are things we need to clean up and do better, but at this point of the year and the situation we're in, we'll take any win any way we can get them.''
Jakob Silfverberg and Derek Grant scored for the Ducks, whose two-game winning streak ended. John Gibson stopped 24 shots in defeat.
Montreal improved to 12-14-4 on home ice.
Canadiens captain Shea Weber missed his first game of the season because of a lower-body injury. Christian Folin took his spot in the lineup.
''Obviously, Shea being out, he's a big piece in this lineup,'' said Petry, who has 35 points this season. ''I think it's our character in here. Guys are going to step up and try to fill these roles and we just have to keep plugging away.''
In overtime, Petry carried the puck all the way from his own zone and the defenseman beat Gibson with a wrist shot on the blocker side for his eighth of the season.
''When we don't have a choice, (Petry) has to step up,'' coach Claude Julien said. ''He's the next one on the right side to take over those responsibilities. That's what he does. You just hope that he does that well and help us cushion the blow of Shea's absence.''
Anaheim was outshooting Montreal 13-5 in the first when Nick Ritchie took an interference penalty. The Canadiens took advantage of the extra skater when Suzuki, using Gallagher as a screen, beat Gibson at 17:18 for his 11th of the season.
''I'm feeling pretty confident,'' said Suzuki, who ranks sixth among rookies for most goals scored this season. ''Nice to get an early goal and settle into the game. Ask anybody, if they get a goal in the first period, they're feeling a lot better for the rest of the game.''
The Canadiens were caught watching the puck on Anaheim's equalizer at 9:53 of the second. Surrounded by four Montreal players in the slot, Silfverberg got his stick on Rickard Rakell's pass from behind the net and roofed a shot on Price.
Gallagher made it 2-1 for the Canadiens with a five-hole goal from the slot at 13:16 on a pass from Ilya Kovalchuk that eluded three Ducks players. Gallagher has three goals in five games since returning from a head injury.
Montreal failed to clear its own zone and Grant netted the equalizer 2:16 into the third, a bouncing shot that sneaked underneath Price's right pad.
With the Canadiens on a power play, Gibson kept his team in it with an incredible glove save on Joel Armia on the doorstep midway through the third. That stop came seconds after Tomas Tatar rifled a shot off the post.
Price did the same late in the third when he stacked the pads and robbed Silfverberg of what appeared to be a sure goal with two minutes on the clock to force overtime.
''Carey Price was excellent right through the game,'' Ducks coach Dallas Eakins said. ''Made a lot of saves. When the game's on the line like that, that's the guy (Silfverberg) we want to have the puck on his stick. But obviously a huge save there by Mr. Price.''
NOTES: The Canadiens have been fighting a bad flu bug this week, with several players under the weather. Price and Victor Mete were back in the lineup after missing Tuesday's 5-4 shootout win in New Jersey. Rookie Ryan Poehling did not dress. ... Canadiens forward Jake Evans made his NHL debut. The 23-year-old had two shots on net, including a breakaway chance in the first. ... Rakell extended his point streak to four games. ... Anaheim's Nicolas Deslauriers faced his former team for the first time.
Ducks: at Toronto on Friday night.
Canadiens: host Toronto on Saturday night.
More AP NHL: www.apnews.com/NHL and www.twitter.com/AP-Sports
Copyright 2020 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.