User alignment refers to linking a user's accounts across multiple social networks, which is important for studying community discovery, recommendation systems, and other related fields. However, existing methods primarily perform user alignment by correlating user features, neglecting the causal relationship between network topology and user alignment, which makes it challenging to achieve superior user alignment accuracy and generalization capabilities. Therefore, we propose a counterfactual inference-based social network user-alignment algorithm (CINUA). This improves user connection retention due to the non-Euclidean geometric characterization of hyperbolic spaces. The similarity of aligned users is augmented using a hyperbolic graph attention network. User-feature embedding and fusion facilitate user relevance mining. Furthermore, there are causal relationships between network topology structure and user linkages. In various communities, there are some highly similar user pairs, and based on counterfactual inference, the network topology is adjusted to enhance sample diversity. Multilevel factual and counterfactual networks are constructed through iterative diffusion based on user alignment and their linkages. By integrating the users' causal features in multiple networks, the accuracy and generalization capabilities of the user alignment model are effectively improved. In this article, the experimental results indicate that CINUA achieves a user alignment accuracy improvement of 5.98% and 3.03%, on two datasets respectively compared to the baseline methods on average. CINUA can achieve favorable alignment results even when the training dataset is small. This demonstrates that our algorithm can ensure both user alignment accuracy and generalization capability.