Gills and gut are the two primary osmoregulatory organs in fish. Recently, studies have expanded beyond the osmoregulatory mechanisms of these organs to explore the microbiota communities inhabiting them. It is now known that microbial communities in both organs shift in response to osmotic stress. However, there are limited studies identifying the major contributors and co-occurrence among these microbiota in both organs under seawater and freshwater transfer conditions. The current data mining report performed a bioinformatics analysis on two previous published datasets from our group, aiming to provide insights into host-bacteria relationships under osmotic stress. We divided the samples into four groups: control seawater gills (LSW); control seawater gut (TSW); freshwater transfer gills (LFW); and freshwater transfer gut (TFW). Our results showed that LSW had higher diversities, richness, and evenness compared to TSW. However, both the LFW and LSW did not show any significant differences after the freshwater transfer experiment. We further applied co-occurrence network analysis and, for the first time, reported on the interactions of taxa shaping the community structure in these two organs. Moreover, we identified enriched ectoine biosynthesis in seawater samples, suggesting its potential role in seawater environments. Increased mRNA expression levels of Na+/K+-atpase, and cftr, were observed in gills after 6 h of ectoine treatment. These findings provide a foundation for future studies on host-bacteria interactions under osmotic stress.