Affiliative social behavior relieves the physiological reactivity to stressors, while social inequity, represented by unfairness in the social environment, causes emotional distress in animals. Mast cells are immune cells found in the brain that affect both the nervous system and emotional behavior. To determine the role of neuro-immunity in the programming of emotional behaviors, we observed brain mast cells and anxiety-like behaviors in female rats exposed to electrical foot shocks in different social environments. The following groups of rats were used in this study: control (unshocked) rats, solitarily shock-exposed rats, and shock-exposed rats in the presence of unshocked (unequal) or shocked (equal) conspecifics. An absence of significant difference in body weight or sucrose preference was seen among the different groups. Additionally, fear memory was augmented in rats shocked in the presence of either unshocked or shocked conspecifics than rats in the solitarily shocked group. Furthermore, rats shocked in the presence of unshocked conspecifics showed intensified anxiety-like behaviors after fear conditioning. Finally, we found an increase in the number of habenular mast cells in the intensified anxiogenic group, which had a significant correlation with the decreasing rate of anxiety-like behaviors. This provides evidence that habenular mast cells might be of importance in relieving the amplified biopsychological responses caused by social stress.