Dos Santos Correa et al. show that exposure to a stressful context promotes the acquisition of rescue behavior in mice and that the dorsal hippocampus is required for this learning. Calcium imaging reveals synchronized neuronal ensembles in the dHPC that mechanistically support successful prosocial rescues.