I think such an act would be an intervention by the superego (conscience). Our conscience regulates our primal instincts and, as social animals, decides what is right and what is wrong. It is also an extension of our self-perception, it's what we project onto the world around us. Many people have a superego that tells them 'this is the kind of person I want to be perceived as' or 'this is the person I know I should be', based on the society in which they were raised. So when we take our lives to save others, it is because our superego has forfeited our ego in order to avoid a life of guilt and self-shame for betraying our superego which would, to us, feel like our place in the world had been invalidated. 'The id reigns supreme' was a slight overstatement, perhaps, but it is the root of all human thought-processes.
But what you said is pertinent because I think it's an example of 'good' selfishness, and it goes back to what Hajduk said. If all humans are self-interested, and if the superego is formed by society and nurture, then that means it is indeed the material elements and prevailing ideology of a society that forms the conscience of humanity, which means the inherent selfishness of humankind can be appropriately harnessed. It goes back to what Plato taught us: the happiest people in life are those that make moral choices and live just lives, whereas the wealthy and powerful are generally miserable, dull and depressed. Being a wise and righteous person is the highest form of pleasure there is, and so being good is not an obligation or a chore but actually something we should all strive for if we want true happiness, and thus a selfish aim.