You can't take a $79m cap team against an $80m cap, bring in a $5m cap player and expect to get $5m to spend over the cap. You were never compliant before the player was injured to go on LTIR.
To get the LTIR clearance, you first need to be cap compliant, then the next day LTIR said player. We fail the compliance in the first place, thus don't get the benefit since we already violated the cap.
However, at a $79m cap, you have one of those players get injured - say the player gets $7m, you now have freed up $6m to go over that $80m cap... as your cap complaint team with $1m in space just freed up another $6m as that is how much over a full replacement contract would cost.
The key is, you need to be compliant first. In your scenario, we are going over the cap first. That's why it can't be done.