In real life, it is not unusual that we face potential threats (i.e., physical stimuli and environments that may cause harm or danger) with other individuals together, yet it remains largely unknown how threat-induced anxious feelings influence prosocial behaviors such as resource sharing. In this study, we investigated this question by combining functional magnetic resonance imaging and a novel paradigm. Together with an anonymous partner, each participant faced the possibility of receiving a 10-s noise administration, which had a low or high probability to be a threat (i.e., the intensity of noise can induce a high level of unpleasantness). Each participant first reported her/his immediate feeling of anxiety about the current situation (being threatened by the unpleasant noise), then decided how to split a number of resources (which could relieve the noise) between her/him and the partner. Behavioral results revealed that the participants showed a selfish bias in the threat conditions than in the safe conditions, and that self-reported anxiety feeling significantly predicted this bias. Functional magnetic resonance imaging results revealed that: (1) the activation level of the anterior insula was correlated with self-reported anxiety and (2) the connectivity between the anterior insula and the temporoparietal junction was sensitive to the modulating effect of anxiety on the selfish bias. These findings indicate the neural correlates of the association between threat-induced anxiety and prosocial tendencies in social interactions.