Intestinal microbiota plays key roles in maintaining the health and homeostasis of the host. However, information about whether the formation of intestinal microbiota of wild aquatic animals is associated with habitat microbes is not fully understood. Here, intestine samples were collected from two wild crab species and sediment samples were collected from the habitat environment. The total DNA of each sample was extracted, and the V3–V4 regions of 16S rRNA were sequenced using the MiSeq platform. The purpose of this study was to investigate the composition and diversity of intestinal microbiota and habitat microbes, and bacterial community relationships between wild crab intestine and habitat sediment. In the present study, the composition and diversity of intestinal microbiota of the two crab species were different from the habitat microbes. In contrast, a similar composition and diversity of the intestinal microbiota were observed between two crab species. Moreover, the bacterial community relationships between crab intestine and habitat sediment were associated with intestinal regions. Further network analysis revealed that the network structure of the intestinal microbiota was not only associated with intestinal regions, but also with the crab species. Additionally, although the compositions of bacterial functions were similar between crab intestine and sediment, no significant correlation in bacterial functions was observed between crab intestine and sediment. The findings of the present study would contribute to understanding the relationship between intestinal microbiota of wild aquatic animal and habitat microbes, and providing new insights into the intestinal microbiota of wild aquatic animals.