The gut microbiota in animals is a dynamic ecosystem influenced by both the host itself and the environment it inhabits. It is known that short-term captivity can significantly impact the gut microbiota of plateau zokors, leading to substantial inter-individual variation. However, the specific changes in the assembly process of the gut microbiota in plateau zokors during captivity remain unclear. In this study, we conducted a comparative analysis on the assembly process of the gut microbiota in 22 male plateau zokors from the same location in Qinglin Township, Datong County, Qinghai Province, before (W) and after (L) laboratory rearing. We performed a single-factor correlation network analysis on the top 50 genera with relative abundance in each group. The results revealed that captivity increased the complexity of the gut microbiota in plateau zokors, indicating a higher number of interactions between different microbial species. However, this increase in complexity was accompanied by a decrease in stability, suggesting a higher degree of variability and potential disruption in the microbial community. According to the results of the neutral community model, the gut microbiota of plateau zokors in the W had a higher Nm value (Nm = 48,135) compared to the L (Nm = 39,671), indicating that species dispersal of the gut microbiota was greater in the wild than in captivity. In the wild, the modified stochasticity ratio (MST) was less than 0.5, suggesting that deterministic processes dominated. However, after 15 days of laboratory rearing, the MST became greater than 0.5, indicating a shift toward stochastic processes, and this difference was highly significant (p < 0.001). This differs from research related to aboveground animals. This study provides theoretical support for the application of gut microbiota in subterranean endangered species.