In the aquatic farming industry, understanding the factors affecting fish behavior is crucial, particularly in response to infections that compromise welfare and productivity. Swimming performance is a key life history trait critical to their ecology. This study explores the swimming behavior imbalance in Nile tilapia (Oreochromis niloticus, GIFT) post-infection with Streptococcus agalactiae (GBS), a common pathogen responsible for significant losses in aquaculture. We focused on how the microbiota-gut-brain axis influences the behavioral response of tilapia to GBS infection. Behavioral changes were quantified by measuring collision times and swimming speeds, which decreased significantly following infection. This behavioral downturn is mediated by alterations in the microbiota-gut-brain axis, evidenced by increased levels of monoamine neurotransmitters (serotonin, norepinephrine, and dopamine) in the brain and intestinal tissues. The study utilized pharmacological agents, the 5-HT1A receptor agonist (8-OH-DPAT) and antagonist (WAY-100635), to investigate their efficacy in mitigating these behavioral and biochemical changes. Both agents partially restored normal behavior by adjusting neurotransmitter concentrations disrupted by GBS infection. Additionally, a notable increase in the relative abundance of Streptococcus within the gut microbiota of infected fish highlights the potential role of specific bacterial populations in influencing host behavior. This research provides novel insights into the complex interactions between pathogen-induced gut microbiota changes and Nile tilapia's behavioral outcomes, highlighting potential avenues for improving fish health management through microbiota-targeted interventions.