Personally I think it depends on how much the person is worth to you.
I do think that ultimately your own life matters the most to you, and even if it would help others if you stayed around, no one can hold it against you if you still decide to leave.
Though I also respect the peoples decision if they voluntarily give up on what they want for the sake of someone else.
If that's what they want I think that in a sense they're still putting their own interests first, in that case it's just that they value what they do for that other person higher than what they'd do for themselves.