Voluntary help during a time of need fosters interpersonal gratitude, which has positive social and personal consequences such as improved social relationships, increased reciprocity, and decreased distress. In a behavioral and a functional magnetic resonance imaging (fMRI) experiment, participants played a multiround interactive game where they received pain stimulation. An anonymous partner interacted with the participants and either intentionally or unintentionally (i.e., determined by a computer program) bore part of the participants’ pain. In each round, participants either evaluated their perceived pain intensity (behavioral experiment) or transferred an amount of money to the partner (fMRI experiment). Intentional (relative to unintentional) help led to lower experience of pain, higher reciprocity (money allocation), and increased interpersonal closeness toward the partner. fMRI revealed that for the most grateful condition (i.e., intentional help), value-related structures such as the ventromedial prefrontal cortex (vmPFC) showed the highest activation in response to the partner’s decision, whereas the primary sensory area and the anterior insula exhibited the lowest activation at the pain delivery stage. Moreover, the vmPFC activation was predictive of the individual differences in reciprocal behavior, and the posterior cingulate cortex (PCC) activation was predictive of self-reported gratitude. Furthermore, using multivariate pattern analysis (MVPA), we showed that the neural activation pattern in the septum/hypothalamus, an area associated with affiliative affect and social bonding, and value-related structures specifically and sensitively dissociated intentional help from unintentional help conditions. These findings contribute to our understanding of the psychological and neural substrates of the experience of interpersonal gratitude and the social consequences of this emotion.