Quoting: palhal
You just can't move up players to the lineup. The guys that is injured still counts against the cap unless in goes on LTIR which is a minimum of 10 games.
teams are allowed emergency call-ups https://www.dkpittsburghsports.com/2019/10/12/nhl-standard-emergency-recall-rules-differences-tlh
"Emergency conditions apply when a team “is reduced below the level of two goalkeepers, six defensemen and 12 forwards,” per the CBA."
"This means that even if a team has enough players to dress, say, seven defenseman and 11 forwards, as teams sometimes do by choice with a healthy roster during the season, it's still considered an emergency situation. If a team doesn't have enough players for four forward lines and three defense pairings, even if they have 18 total healthy skaters otherwise, it's an emergency situation.
Example: The Penguins used three emergency recalls on forwards because they did not have 12 healthy forwards, even though they were carrying extra defensemen."
this could be applied if say Dermott got injured but they still have 13 fwds
I'm not sure how emergency recalls affect the cap, I couldn't find it in writing, but I know the leafs have used them in prior years when they were near the cap and were still compliant. If I had to guess, it would be similar to LTIR in which they'd be allowed to go over the cap with the recalled player but they cannot accumulate cap space in that time period.