This is covered by Rule 5.3 of the NHL rulebook
In regular League and Playoff games, if both listed goalkeepers
are incapacitated, that team shall be entitled to dress and play any
available goalkeeper who is eligible.
In order to make Robb Tallas an "eligible" player, the Panthers will almost certainly have had him sign a one-day contract. At that point, it doesn't matter that he wasn't on the roster at the start of the day, or even the start of the match - he's an available goalkeeper. One thing potentially worth noting here is that this kind of situation isn't completely clear, even to NHL teams. Quoting from this ESPN report from the NHL's 2015 general managers' meeting:
Though goaltending coach Robb Tallas was on hand in case he was needed, there was some initial confusion about who was allowed to suit up. [...] While most teams have someone on staff that may have some goaltending experience, it remains to be seen whether those people would be eligible. [Colin Campbell, the NHL's Director of Hockey Operations] said that the NHL's central registry will have some input on that issue."
That's the legalese, but the practicalities of the situation are that hockey goalkeepers are such specialised players that you can't just expect another player to put on some goalie pads and be able to play - that's the difference from basketball, where the positions are much more equivalent.