With the ever-changing social environment, stress has exerted a substantial influence on social interaction. The present study examined the underlying cognitive and neural mechanism on how acute stress affected the real-time cooperative and competitive interaction with four hypothesized path models. We used the hyperscanning technique based on functional near-infrared spectroscopy (fNIRS) device to examine brain-to-brain coherence within the dyads engaging Pattern Game under acute stress manipulated through Trier Social Stress Test for Groups. Behavioral results showed stressed dyads exhibited better cooperative performance and higher self-other overlap level during the cooperative session than dyads in the control group. The fNIRS results identified higher interpersonal brain synchronization in the right temporal-parietal junction (r-TPJ) stronger Granger causality from partner-to-builder during the cooperative session in the stress group when compared with the control group. Our results corroborated better performance in the cooperative context and further identified that brain-to-brain coherence in r-TPJ and self-other overlap serially mediated the effect of acute stress on cooperative performance.