WINNIPEG — It was a fairy tale ending for Teemu Selanne on Saturday, and a lousy blast from the past for Curtis Joseph.

Selanne beat Joseph between the pads on a penalty shot with four seconds left in the third period to lift the Winnipeg Jets to a 6-5 victory over the Edmonton Oilers in the Heritage Classic alumni game at Investors Group Field.

"I thought my nightmares with Teemu were over," said Joseph. "He's a world-class player, obviously.

"I could have practised 20 hours and I don't think I could have stopped him."

Selanne, who only retired from the NHL in 2014, also had the game's first goal on a penalty shot and added three assists.

Fans had cheered the Finnish Flash loudly before, during and after the game, continuing a passion for the player who began his NHL career in Winnipeg in 1992-93.

Even Oilers legend Wayne Gretzky said the ending fit perfectly with the contest that celebrates the teams and their hockey history.

"You can tell how big the hockey is here," Gretzky said of the "tremendous" crowd of 31,317 fans wearing Jets and Oilers jerseys.

"The hockey, obviously, wasn't great hockey, but it was competitive. And the game ended the way it should end — with the best player on the ice, on the home team, scoring a big goal."

The Great One was playing in his second NHL outdoor game — he took part in the first one in Edmonton in 2003 — and was held off the score sheet.

That didn't surprise the scoring legend, seeing as how he rarely puts skates on anymore.

"I stink," Gretzky, 55, said to laughter when asked to assess his play. "I'm really bad. At least I forewarned people.

"Mark (Messier) went down and he snapped that first goal and went down and snapped the second one and I was like, 'Oh my god, he can still play.' Nobody's saying that about Wayne Gretzky. But I didn't have any expectations and I didn't tell anybody that I was going to go out there and be the Wayne Gretzky of the '80s."

Selanne was teased about how much hand he had in writing the game's script.

"Actually nothing, but I got a little help there," replied Selanne, who was tripped by Edmonton's Craig Simpson to set up the opportunity for glory.

"Obviously, it was a great ending, too, but the whole weekend has been unbelievable."

Selanne received the key to the city Friday from Winnipeg Mayor Brian Bowman, who talked about the friendly Finn and the impact he had in almost four seasons with the Jets.

"He's a people person and every-day hard worker," said fan Tyson Snelling, who was sporting a Selanne jersey as he sipped a beer during the second intermission.

"It's what we expect and what we see here in Winnipeg and Manitoba."

Selanne's first goal sparked a 4-1 Winnipeg lead in the first period, with Kris King, Dale Hawerchuk and Mike Eagles also scoring.

But the Oilers responded with three straight in the second thanks to Simpson, Messier and Craig MacTavish.

Edmonton was leading 5-4 early in the third on a goal by 62-year-old B.J. MacDonald when King scored his second of the game to tie it up at 16:47.