As for the wild animals, their diet components are always changed, so that we have to monitor such changes by analyzing the modification of intestinal microbial community. Such effort allows us to amend their conservation strategies and tactics accordingly so that they are able to appropriately adapt to the new environment and dietary selection. In this study we focus on the gut flora of two groups of an endangered species, Alpine musk deer (Moschus chrysogaster), wild group (WG) which is compared with that of the individuals of the same species but kept in the captivities (CG), a control group. Such a project is aimed to work out whether the composition of the gut microbes has significantly been changed due to captive feedings. To do so, we used 16S rRNA amplicon sequencing to characterize gut bacteria of the musk deer from the two groups. The results show that there is a significant difference in community structure of the bacteria: WG shows significant enrichment of Firmicutes and depletion of Bacteroidetes, while CG has a significant abundance of Proteobacteria and Euryarchaeota. Metagenomics was used to analyze the differences in functional enzymes between the two groups. The related results indicate that genes in WG are mostly related to the enzymes digesting cellulose and generating short-chain fatty acids (SCFAs) for signaling pathways, but CG shows enrichment in methanogenesis, including the CO2/H2 pathway and the methylotrophic pathway. Thus, this study indicates that the Firmicutes-rich gut microbiota in the WG enables individuals to maximize their energy intake from the cellulose, and has significant abundance of Euryarchaeota and methanogenesis pathways that allow them to reduce redundant energy consumption in methane metabolism, ensuring them to adapt to the wild environments.