While originally acquired from the environment, a fraction of the microbiota is transferred from parents to offspring. The immune system shapes the microbial colonization, while commensal microbes may boost host immune defences. Parental transfer of microbes in viviparous animals remains ambiguous, as the two transfer routes (transovarial vs. pregnancy) are intermingled within the maternal body. Pipefishes and seahorses (syngnathids) are ideally suited to disentangle transovarial microbial transfer from a contribution during pregnancy due to their maternal egg production and their unique male pregnancy. We assessed the persistency and the changes in the microbial communities of the maternal and paternal reproductive tracts over proceeding male pregnancy by sequencing microbial 16S rRNA genes of swabs from maternal gonads and brood pouches of non-pregnant and pregnant fathers. Applying parental immunological activation with heat-killed bacteria, we evaluated the impact of parental immunological status on microbial development. Our data indicate that maternal gonads and paternal brood pouches harbor distinct microbial communities, which could affect embryonal development in a sex-specific manner. Upon activation of the immune system, a shift of the microbial community was observed. The activation of the immune system induced the expansion of microbiota richness during late pregnancy, which corresponds to the time point of larval mouth opening, when initial microbial colonization must take place.