But the Penguins kept charging, scoring a power-play goal in the final minutes on a deflection by forward Marian Hossa.  Their final gasp was so close to extending this game. In a frantic rush, forward Sidney Crosby fired a shot that glanced off the glove of Detroit goalie Chris Osgood and landed behind him. Hossa poked at the puck and it slid along the goal line before the horn echoed through the arena.  “First of all, it’s never easy,” said Osgood, who won his third Cup with Detroit. “It was chaotic that last 40 seconds. They have a really good team. Crosby was flying. I think time had run out before it started rolling over the side of the net, but I was happy to see the ref yell time was up.”  Crosby, the 20-year-old captain, said he believed for a second the puck would roll in. But the comeback ended there.  Later, Crosby sat at his locker, still in full uniform, his eyes red and his voice wavering. He could think of little but the pain of losing in his first Cup finals.  “It was tough,” he said. “It’s one of those things where, I don’t think we were going to be guilty of not leaving it out there, not giving our all. We were going to go down fighting.”  On the ice at the time, the Red Wings were still passing around the Cup. It is a celebration that never becomes routine, even for the Wings, who cried tears of joy. The first player to get it was captain Nicklas Lidstrom, who became the first European player to be the captain of a Stanley Cup winner. He in turn handed it to forward Dallas Drake, a 16-year veteran who won his first title.  Four other players joined Lidstrom in winning their fourth Cup with Detroit — forwards Tomas Holmstrom, Kris Draper, Kirk Maltby and Darren McCarty — and the roster was filled with veterans of many of these playoff drives.  It was that experience that the Red Wings leaned on in tackling this game, bouncing back from that heartbreaking loss, in which the Cup was mere seconds from being carried onto the ice.  “When you have some players who have been through it before, they know what to expect,” Lidstrom said. “I think that gives the whole team some calmness, that we’re not going to panic. The main thing is, we didn’t get rattled.”  Lidstrom is rattle-proof. He has always been a huge calming influence, even before he took over as captain when Steve Yzerman retired in 2006.  “Coming here on the plane yesterday, everybody was relaxed,” Lidstrom said. “We felt confident as a group.”  They showed it in taking a 2-0 lead, first on a power play goal by defenseman Brian Rafalski in the first and a rebound goal by forward Valtteri Filppula in the second. Pittsburgh cut the lead with a power-play slap shot by center Evgeni Malkin — his first goal of this series — but it was Zetterberg’s goal that made the difference.  Fleury was helpless on Zetterberg’s wrist shot, which trickled though his pads with 12 minutes 24 seconds left in the third. The puck sat loose in the crease behind him until Fleury fell backward, pushing it into the net.  The final twist, though, did not come until the final seconds. That is when the Penguins’ last magic act rolled just short.  N.B.C. announced that its ratings for Monday night’s Game 5 in Detroit — the 4-3 triple overtime victory by the Penguins — had a 3.8 national rating and a seven share, a 111-percent improvement over last year’s little-watched Anaheim-Ottawa clincher. According to the network, it had the best ratings of any Game 5 since Carolina-Detroit got a 4.2 rating and an 8 share in 2002.  A version of this article appears in print on , on Page D1 of the New York edition with the headline: Penguins Raise Scare, but Red Wings Raise Cup. Order Reprints| Today's Paper|Subscribe
The Penguins’ final shot wobbled past the net as the clock ticked to zero, and the Red Wings won the Stanley Cup.