This study explores the complexities of emotional contagion and its influence on performance in collaborative interactions. Specifically, it focuses on the impact of stereotype-based stress (SBS) on female pairs during problem-solving tasks. The research aims to uncover the underlying mechanisms and effects of emotional contagion by utilizing EEG-based hyperscanning technology. A novel approach called functional Graph Contrastive Learning (fGCL) is introduced to extract subject-invariant representations of neural activity patterns. These representations are then analyzed using the Dynamic Graph Classification (DGC) model to examine the process of emotional contagion. By studying brain synchronization and connectivity, the study reveals the intricate relationship between emotional contagion and cognitive functioning. The results highlight the significant role of emotional contagion in shaping participants’ performance during collaborative tasks under SBS conditions. Overall, this research provides valuable insights into the neural basis of emotional contagion, enhancing our understanding of the complexities within social interactions and emotional dynamics.