The Montreal Canadiens drank from the Stanley Cup for the 23rd time tonight after they defeated the Calgary Flames, 4-3, in Game 5 of the best-of-seven NHL final.

The losers had to settle for a postgame chant of "Thank you, Flames," from an appreciative crowd of 16,762. They also were left with the knowledge that they had done a remarkable job in the face of injury and weariness.

When Rick Green and Bobby Smith scored 19 seconds apart midway through the third period, the Canadiens were breezing, 4-1. But the fans stayed, and the Flames refused to surrender.

Steve Bozek scored his second goal of the game with 3:14 remaining to trim the deficit to 4-2. Then, after Calgary lifted goalie Mike Vernon for a sixth skater, Joe Mullen converted Dan Quinn's feed with 46 seconds left to close within a goal.

Goaltender Patrick Roy, who, at age 20, became the youngest winner of the Conn Smythe Trophy as the most valuable player in the playoffs, made a big save on Jamie Macoun with 14 seconds left to preserve the Canadiens' victory.

"That was the longest two minutes of my life," said Montreal defenseman Larry Robinson, who earned his sixth Stanley Cup ring.

"They came very close. Calgary has an excellent team, and they did everything they could. You don't win hockey series or hockey games without luck, and we had the luck throughout the series."

"We never thought we had it won until the puck went out over the blue line with a second left," said Smith, who reached the final once before, with Minnesota in 1981.

"I've wanted this since I was a little boy. Now we can go in our dressing room, with all those pictures of the old heroes and say, 'We've got one, too.' "

Montreal was only seventh-best during the NHL's regular season, and no team that finished that low had ever taken the Cup before.

But the Canadiens benefited from a series of playoff upsets, the most notable being Calgary's elimination of two-time defending champion Edmonton.

"We beat the right people," said Montreal winger Ryan Walter. "The Flames were hurting, but they played fantastic, they worked hard and they never stopped."

Calgary was playing its 19th game in 37 days and was without three key players -- defenseman Gary Suter and forwards Carey Wilson and Colin Patterson. Mullen was playing with a visor and a cervical collar to protect injuries to his face and neck.

So desperate was Calgary Coach Bob Johnson that he started defenseman Neil Sheehy at center and for a while played a line of Sheehy, Tim Hunter and Nick Fotiu, a unit that in 100 previous playoff games had accounted for one goal.

"We milked the cow dry and couldn't get any more out of it," Johnson said. "We battled them hard all the way. A bounce here and a bounce there, who knows?"

"It'll be a few days before I accept what's happened," said Calgary's Lanny McDonald, who, at age 33, was in his first Stanley Cup final.

"I don't think anyone out there could possibly understand what it feels like to have come this far and then feel the disappointment of finishing second."

Penalties had Calgary in early trouble, and McDonald was off for hooking when Gaston Gingras opened the scoring from the slot with a low shot past Vernon on the glove side.

Bozek tied it at 7:17 of the second period, when he was left unguarded in front and made the most of Hunter's superb backhand pass out of the left-wing corner.

The goal ended Roy's shutout streak at 120 minutes 4 seconds. He had shut out the Flames in Game 4.

As they had throughout the series, however, the Canadiens responded to a Calgary goal with one of their own. Mike McPhee hit a post and the puck skipped out past two Flames to Brian Skrudland, who sent it past Vernon to put Montreal ahead to stay.

Green scored his first goal of the playoffs at 10:11 of the third period, faking Mullen out of his path and moving in to lift the puck past Vernon, who was screened by Guy Carbonneau.

When Smith scored in almost identical fashion, 19 seconds later, it appeared that the Flames were dead. But one more time in these playoffs, things did not proceed the way everyone expected.

The final buzzer sent the Canadiens, whose lineup included eight rookies, into a display of joy on the ice, and the celebration continued through numerous champagne shampoos in the dressing room.

While the fans stood and cheered the Flames, Montreal rookie Claude Lemieux jumped on the bench and embraced Coach Jean Perron. Injured Chris Nilan, in civilian clothes, ran onto the ice and hugged Roy.

After the ritual handshakes, the Canadiens received the Cup from NHL President John Ziegler, and captain Bob Gainey held it aloft while the rest of the players jumped to touch it. Although the Flames had departed for the relative quiet of their dressing quarters, the crowd stayed and applauded the winners.

"It's just such an exciting night, I can't explain it anymore," said Skrudland, whose overtime goal in Game 2 began the Canadiens' surge after Calgary had won Game 1.

Roy, who finished the playoffs with an incredible 1.92 goals-against average in 20 games, became only the second rookie to win the Smythe trophy. The other was another Montreal goalie, Ken Dryden, in 1971.

"Now I'm going to be able to sit in my chair at home and say, 'I won something,' " Roy said.