CALGARY, Alberta (AP) Corey Perry came through with another big goal for the Anaheim Ducks to cap their big comeback.

Perry scored 1:30 into overtime and the Ducks rallied from three goals down midway through the second period to beat the Calgary Flames 5-4 Monday night and take a 3-0 series lead in the first-round series.

Perry's sharp-angled shot deflected off several players and past Flames goalie Brian Elliott.

''You just keep pushing shift after shift, get pucks to the net and we found a way tonight,'' Perry said. ''That's all that matters.''

Shea Theodore had two goals, Nate Thompson had a goal and two assists, and Nick Ritchie also scored for the Ducks. Rickard Rakell, Kevin Bieksa and Hampus Lindholm each had two assists.

John Gibson gave up four goals on 16 shots before he was replaced by Jonathan Bernier in the second period. Bernier stopped all 16 shots he faced.

''He was called upon to make some big stops and he made them and we were able to build off it,'' Ducks coach Randy Carlyle said.

Sean Monahan had a goal and an assist, and Kris Versteeg, Sam Bennett and Michael Stone also scored for Calgary. Mikael Backlund and T.J. Brodie each had two assists, and Elliott finished with 22 saves.

Game 4 is Wednesday night.

The Flames started stronger, were more disciplined and sharper in the faceoff circle than they were in a pair of 3-2 losses to open the series in Anaheim. Calgary built a 4-1 lead midway through the second period, scoring three power-play goals on five chances.

The Flames then squandered that effort as Elliott began fighting the puck while his team allowed the Ducks to get bodies in front of the net to score on deflections.

''It's not easy to win in this league, but I think we have what it takes here in this dressing room and we're going to have to find a way,'' Monahan said.

The Theodore got the Ducks' comeback started with 49 seconds left in the middle period as his wrist shot from the boards deflected off Elliott's left pad and into the net.

''We couldn't seem to make two passes together for a better part of I'd say the first two periods,'' Carlyle said. ''Then we got a goal and it gave us some life and made us believe that we have a chance. This is playoff hockey and momentum swings within the game, from shift to shift.''

Thompson deflected Lindholm's shot from inside the blue line under Elliott with 8:46 left in the third to pull Anaheim within one, and Theodore scored his second goal of the game on a shot from the point to tie it with 4:21 remaining.

Monahan, on Gibson's doorstep, converted Troy Brouwer's feed from behind the net into his third power-play goal of the series to get the Flames on the scoreboard first at 2:10 into the game.

Versteeg banged a rebound by a sprawling Gibson during a goal-mouth scrum on a power play at 9:18 for a 2-0 lead.

Ritchie cut Anaheim's deficit in half with 4:27 remaining in the first, knocking in a rebound off Antoine Vermette's shot from the top of the faceoff circle.

Stone scored even-strength at 4:34 of the second, threading a shot through traffic and past Gibson stick side, and Mark Giordano's shot from the point deflected off Bennett's foot for a 4-1 Calgary lead at 8:33.

Then the Ducks pushed back.

Anaheim captain Ryan Getzlaf and Perry are the two remaining players from its Stanley Cup win in 2007. Getzlaf's leadership helped spark his team when they were trailing.

''We got kind of down on ourselves,'' Theodore said. ''We have some leaders on our team like Getzlaf and he perked us up a little bit.''

Perry, playing in his 100th postseason game, also had an assist for a career 80 playoff points.

NOTES: Ducks D Sami Vatanen participated in the morning skate, but was scratched a second straight game. He sustained an upper-body injury when he was checked by Calgary's Lance Bouma in Game 1. ... Fowler skated after his teammates in the morning. Ducks coach Randy Carlyle indicated the 25-year-old is recovering from his knee injury, but did not provide a timetable for Fowler's return. ''We think that he's on pace to be available to us some time here shortly,'' Carlyle said.

Copyright 2017 by Associated Press. Any commercial use or distribution without the express written consent of Associated Press is strictly prohibited.