Lepidopterans commonly feed on plant material, being the most significant insect herbivores in nature. Despite plant resistance to herbivory, such as producing toxic secondary metabolites, herbivores have developed mechanisms encoded in their genomes to tolerate or detoxify plant defensive compounds. Recent studies also highlight the role of gut microbiota in mediating detoxification in herbivores; however, convincing evidence supporting the significant contribution of gut symbionts is rare in Lepidoptera. Here, we show that the growth of various lepidopteran species was inhibited by a mulberry-derived secondary metabolite, 1-deoxynojirimycin (DNJ); as expected, the specialist silkworm Bombyx mori grew well, but interestingly, gut microbiota of early-instar silkworms was affected by the DNJ level, and several bacterial species responded positively to enriched DNJ. Among these, a bacterial strain isolated from the silkworm gut (Pseudomonas fulva ZJU1) can degrade and utilize DNJ as the sole energy source, and after inoculation into nonspecialists (e.g., beet armyworm Spodoptera exigua), P. fulva ZJU1 increased host resistance to DNJ and significantly promoted growth. We used genomic and transcriptomic analyses to identify genes potentially involved in DNJ degradation, and CRISPR-Cas9-mediated mutagenesis verified the function of ilvB, a key binding protein, in metabolizing DNJ. Furthermore, the ilvB deletion mutant, exhibiting normal bacterial growth, could no longer enhance nonspecialist performance, supporting a role in DNJ degradation in vivo. Therefore, our study demonstrated causality between the gut microbiome and detoxification of plant chemical defense in Lepidoptera, facilitating a mechanistic understanding of host-microbe relationships across this complex, abundant insect group.