Social isolation hampers immune system function, and the biological mechanisms driving this effect remain understudied. We hypothesized that oxytocin (OT), a key neuropeptide involved in social cognition, is a critical mediator of social context on immune function. In the California mouse (Peromyscus californicus), we examined how female and male immune function is influenced by (1) social isolation from same-sex peers, (2) social peer affiliation, and (3) exogenous OT. We evaluated immune function through wound size progression following a skin biopsy and proinflammatory cytokines in the wound fluid. Unexpectedly, social isolation alone did not influence wound healing, but isolation + OT increased wound size in a dose dependent manner. Wound size progression interacted with sex and OT in socially-housed mice, suggesting that OT increases inflammation in females, while decreasing inflammation in males in a social context-dependent manner. Inflammatory biomarker interleukin-6 (IL-6) mRNA expression correlated with wound size overall, supporting wound healing as an index of inflammatory response. However, isolation + OT mice did not have higher levels of IL-6, suggesting that the mechanism through which isolation + OT influences wound size is not through IL-6 activity. Behaviorally, higher levels of affiliation were negatively associated with wound size, and this effect was diminished by OT treatment. Our results highlight that the anti-inflammatory effects of OT are likely highly dependent on social context.