Has any NHL team ever won a game after being down 0-5? It would clearly be quite difficult and arguably miraculous.
This has happened six times in NHL history so is not as uncommon as you suspect:
Wayne Gretzky probably doesn't want to remember this one, but the Oilers lost to the Kings 6-5 in 1982 in the playoffs (Game 3 of the Smythe division semi-finals that year) after leading 5-0 after 2 periods. Not only did the Kings come back from down 5-0, but they came back entirely in the 3rd period and OT, scoring their last 3 goals of regulation in less than six minutes, and the tying goal on the power play with only 5 seconds remaining in regulation.
Contributing to the demise were a ton of penalties in the second half of the third period - this was not super uncommon back then, but there was a ton of offsetting penalties leading to quite a long time of 4-on-4 play, which undoubtedly simplified things, plus the high-stick major by Gary Unger at exactly 15:00 that meant that the Kings were able to play two men up after pulling their goalie for the last three minutes. That plus some shenanigans with goaltenders that gave the Kings a breather allowed them to finally score at nearly the last second.