The Dioryctria genus contains several destructive borer pests that are found in coniferous forests in the Northern Hemisphere. Beauveria bassiana spore powder was tested as a new method of pest control. In this study, Dioryctria sylvestrella (Lepidoptera: Pyralidae) was used as the object. A transcriptome analysis was performed on a freshly caught group, a fasting treatment control group, and a treatment group inoculated with a wild B. bassiana strain, SBM-03. Under the conditions of 72-h fasting and a low temperature of 16 ± 1 °C, (i) in the control group, 13,135 of 16,969 genes were downregulated. However, in the treatment group, 14,558 of 16,665 genes were upregulated. (ii) In the control group, the expression of most genes in the upstream and midstream of the Toll and IMD pathways was downregulated, but 13 of the 21 antimicrobial peptides were still upregulated. In the treatment group, the gene expression of almost all antimicrobial peptides was increased. Several AMPs, including cecropin, gloverin, and gallerimycin, may have a specific inhibitory effect on B. bassiana. (iii) In the treatment group, one gene in the glutathione S-transferase system and four genes in the cytochrome P450 enzyme family were upregulated, with a sharp rise in those that were upregulated significantly. In addition, most genes of the peroxidase and catalase families, but none of the superoxide dismutase family were upregulated significantly. Through innovative fasting and lower temperature control, we have a certain understanding of the specific defense mechanism by which D. sylvestrella larvae may resist B. bassiana in the pre-wintering period. This study paves the way for improving the toxicity of B. bassiana to Dioryctria spp.