TDP-43 is an important DNA/RNA-binding protein that is associated with age-related neurodegenerative diseases such as amyotrophic lateral sclerosis (ALS) and frontotemporal dementia (FTD); however, its pathomechanism is not fully understood. In a transgenic RNAi screen usingDrosophilaas a model, we uncovered that knockdown (KD) ofDsor1(theDrosophilaMAPK kinasedMEK) suppressed TDP-43 toxicity without altering TDP-43 phosphorylation or protein levels. Further investigation revealed that theDsor1downstream generl(dERK) was abnormally upregulated in TDP-43 flies, and neuronal overexpression ofdERKinduced profound upregulation of antimicrobial peptides (AMPs). We also detected a robust immune overactivation in TDP-43 flies, which could be suppressed by downregulation of the MEK/ERK pathway in TDP-43 fly neurons. Furthermore, neuronal KD of abnormally increased AMPs improved the motor function of TDP-43 flies. On the other hand, neuronal KD ofDnr1, a negative regulator of theDrosophilaimmune deficiency (IMD) pathway, activated the innate immunity and boosted AMP expression independent of the regulation by the MEK/ERK pathway, which diminished the mitigating effect of RNAi-dMEKon TDP-43 toxicity. Finally, we showed that an FDA-approved MEK inhibitor trametinib markedly suppressed immune overactivation, alleviated motor deficits and prolonged the lifespan of TDP-43 flies, but did not exhibit a lifespan-extending effect in Alzheimer disease (AD) or spinocerebellar ataxia type 3 (SCA3) fly models. Together, our findings suggest an important role of abnormal elevation of the MEK/ERK signaling and innate immunity in TDP-43 pathogenesis and propose trametinib as a potential therapeutic agent for ALS and other TDP-43-related diseases.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12979-023-00354-8.