After Philadelphia forward Brayden Schenn scored to tie the game 3-3 at 3:06, Anaheim coach Randy Carlyle pulled Gibson to calm him and to set a new game plan.
WATCH: All Flyers vs. Ducks highlights
"The whole idea was to use it as a timeout," Carlyle said. "I told Bernier he was only going in until the media timeout: 'Give us three minutes.'"
The Ducks said they saw a sharper, more focused goaltender when Gibson returned.
"He showed that he was mentally strong," Kesler said. "He was controlling his rebounds better and just mentally and physically more sound."
Corey Perry scored the deciding goal in the fifth round of the shootout for the Ducks (19-12-8). Rickard Rakell scored for Anaheim in the first round, and Philadelphia's Jakub Voracek scored in the third.
The Flyers outshot the Ducks 55-25, including 38-13 in the first and second periods.
"It's not something that happens every day, but it was a big test," Gibson said. "There are games when I'll only see 15 shots. Sometimes you'll see more than others, and that was the case tonight."
Travis Konecny and Sean Couturier also scored for Philadelphia (20-14-5), which has lost four straight games (0-3-1).
After injuring his hand and leaving a 2-0 loss at the San Jose Sharks on Friday after the first period, Flyers goalie Steve Mason returned to make 22 saves.
"It's not fun when they're not going in, but we have to keep plugging away," Philadelphia defenseman Michael Del Zotto said. "It's part of the game. Every team has great goalies. Their job is to make saves, so you're not going to score every time. You want to look at the positives and try to build off that."
Kesler made it 1-0 at 7:55 of the first period by tipping in a backhand feed from defenseman Korbinian Holzer.
Konecny tied the game 1-1 19 seconds later when he collected his own rebound and banked it in off Gibson's pad.
Kesler scored again at 16:54 of the first to give the Ducks a 2-1 lead, and then completed his hat trick 1:09 into the second period to put Anaheim up 3-1.
But Couturier (1:46) and Schenn (3:06) scored 1:20 apart to tie it 3-3.
"You really couldn't fault [Gibson] on the goals," Carlyle said. "It was poor defensive-zone coverage from our perspective."
Ducks center Ryan Getzlaf left the game early in the third period with a lower-body injury.
Gibson faced an NHL career-high 54 shots, three shy of the most in Ducks history. Bernier made one save in his brief appearance.