Sacrificing own resources for the benefit of others is a prerequisite for society to function well. The willingness to do so, however, greatly declines as the perceived social distance from the other persons increases. Here, we asked if describing a generous choice as preventing a loss to others rather than granting them a gain would promote generosity, even towards socially remote strangers. We adapted a social discounting task where participants chose between a selfish and a costly generous option, yielding either advantageously unequal or fair financial outcomes. We manipulated the description of the decision problem in two economically equivalent frame-conditions: in the gain frame, a generous choice yielded a gain to the other, while, in the loss frame, it entailed preventing the loss of a previous endowment to the other. In four behavioral replications, we found that social discounting was strongly reduced in the loss than the gain frame, implying that participants were more generous toward remote strangers. We hypothesized that the motives underlying generosity in social discounting are frame-dependent and dissociable on the neural level. Using functional magnetic resonance imaging, we found that temporoparietal junction and ventromedial prefrontal cortex subserved generosity in the gain frame, replicating our previous finding, while anterior insular cortex was selectively recruited during generous choices in the loss frame when participants prevented the other-loss. This suggests that anterior insula promoted generosity toward strangers by encoding an anticipated harm prevention signal. These results extend our understanding of the role of insula in nudging prosocial behavior.