The recognition of communication relationships under Non-cooperative conditions is significant for understanding the network composition of unknown targets, inferring network topology, and identifying key nodes, which is a prerequisite and basis for conducting efficient electronic countermeasures. However, under Non-cooperative conditions, for prior knowledge related to the target network is difficult to obtain, the communication relationships recognition faces enormous challenges. To address this issue, we construct a system model, analyze the mechanism of wireless communication interaction, extract feature series of signals from spectrum monitoring data, and propose a Transformer-based algorithm for recognizing target network communication relationships. This paper conducts simulation experiments in different scenarios to compare the Transformer-based communication relation recognition algorithm with the other four methods, such as SVM, CNN-based recognition algorithm, ResNet-based recognition algorithm, and LSTM-based recognition algorithm, respectively. And results demonstrate that the proposed algorithm shows high recognition accuracy, good anti-interference performance, and robustness.