CHICAGO -- The Edmonton Oilers,who had the NHL's worst record last season, are playing better on the road.
Meanwhile, the defending Stanley Cup champion Chicago Blackhawks seem to be losing their edge on home ice.
Nikolai Khabibulin made 26 saves for Edmonton, which improved to 2-2-2 on the road this season and 4-23-3 in its last 30 games away from home dating to December 2009.
Both of the Oilers' road wins this season have been in Chicago, which dropped to 4-6-0 at home. Edmonton defeated the Blackhawks 7-4 at the United Center on Oct. 29.
"We're trying to remain humble and within ourselves," Edmonton coach Tom Renney said. "We're definitely a work in progress. It's games like this that help you grow in a hurry."
Chicago was ahead 1-0 on a goal from ex-Oiler Fernando Pisani and seemingly in control. Then, Foster scored on a power play to tie it and Gagner followed with the game-winner.
"We seemed like we couldn't score," Gagner said. "Then we got a couple in 14 seconds, so it's a great feeling."
Chicago got 24 saves from backup Corey Crawford in his fourth start and fifth game of the season. But for the fifth time in their six home setbacks, the Blackhawks lost the game in the third period.
"I think that's our sore spot this year: The inability to close teams out and win at home," coach Joel Quenneville said. "I think that was one of our strengths the last couple of years. We've got to re-establish home-ice advantage."
The Blackhawks have lost three straight at home, including twice to the Oilers and once to injury-depleted New Jersey.
"Losing two games to these guys in our own building is not a good thing," Chicago defenseman Brian Campbell said. "It's unacceptable. We've got to get a little mad in the locker room and go out there and win some more battles."
Blackhawks star forward Marian Hossa returned after missing five games with a shoulder injury.
Pisani, signed as a free agent by Chicago from Edmonton in the offseason, scored the only goal of the first period at 10:23. He skated in from the right circle and fired a shot under Khabibulin's glove on the short side.
Crawford wasn't heavily tested, but did make a couple of tough stops in the scoreless second period. His best was a quick right pad save on Andrew Cogliano 7:40 into the period.
Crawford made another point-blank pad save on Cogliano in the first minute of the third following a turnover by Chicago'sDuncan Keith. Seconds later, Edmonton's Taylor Hall fired the rebound off the right post.
Foster ended Crawford's shutout bid at 7:13 of the third with a power-play goal from a sharp angle. Following a faceoff in the Chicago zone, Foster's screened shot from the right circle slid underneath Crawford's pads.
"It's amazing," Foster said. "You can shoot 30 shots in a row hard, and the one you kind of whiff on goes through. It got through five-hole."
Gagner put Edmonton ahead 2-1 just 14 seconds later when he slipped through the crease alone and knocked in Dustin Penner's pass while falling to the ice.
"It's unacceptable to lose the game in one minute," Hossa said. "We played a pretty good defensive game up to the third period. As a championship team, we have to respond better."
Edmonton opened a five-game road trip that will last nine days. ... The Oilers played their final regular-season game at the United Center this season. ... Blackhawks C Dave Bolland missed his fifth game with an upper-body injury. ... Oilers LW Steve MacIntyre missed his third game with a back injury. Edmonton D Theo Peckham missed his second with the flu.