The processing of stress responses involves brain-wide communication among cortical and subcortical regions. Although considerable effort has been made to discover these brain regions, hypothesis-free and unbiased approaches to identify previously unknown neural elements have been limited until recently due to technical limitations. Here, we performed whole-brain activation mapping and machine learning-based analyses to identify previously uncharacterized brain regions and neuronal ensembles implicated in stress, and found that the claustrum (CLA) most prominently contributes to discrimination in stressed brains. Activity-dependent genetic labeling in TRAP2 mice subjected to social defeat stress revealed reciprocal connection of the CLA with fos-tagged neurons in brain-wide areas, including the basolateral amygdala and medial prefrontal cortex. Chemogenetic reactivation of the fos-tagged CLA neuronal ensemble reproduced anxiety-like behaviors and brain-wide neuronal activation, while its silencing attenuated anxiety-like behaviors induced by acute social defeat stress and increased resistance to chronic social defeat stress. The CLA thus controls stress-induced emotional responses bidirectionally through brain-wide networks, and its inactivation can be a preventative measure that increases stress resilience.