Ochratoxin A (OTA), a secondary metabolite produced by Aspergillus and Penicillium, seriously contaminates grapes and its products. Inhibiting the growth of OTA-producing fungi is the best approach to reduce OTA contamination in grapes. This study was to reveal the inhibition mechanism of Lactobacillus brevis 8–2B on Aspergillus westerdijkiae. Research has found that L. brevis 8–2B could inhibit the germination, growth, and OTA synthesis of A. westerdijkiae. The antifungal activity of L. brevis 8–2B is attributed to the synergistic effect of acetic acid, lactic acid, citric acid, longifolene, methyl salicylate, 3-phenyl-2-propenal, nystatin, and itraconazole. The inhibitory effect of L. brevis 8–2B on A. westerdijkiae was the synergistic effect of these active substances. Ultrastructure observation and flow cytometry results showed that the mycelia structure, cell membrane and cell wall of A. westerdijkiae were disrupted, the cells showed apoptosis, and the ergosterol content in the cells was reduced. Transcriptome analysis revealed that the expression levels of ribosomal biosynthesis genes and cell wall chitin synthesis genes in inhibited A. westerdijkiae were up-regulated, while the expression of chitin degrading enzyme genes was down-regulated to enhance its primary growth and development. In addition, L. brevis 8–2B also inhibits the expression of amino acid synthesis and glycolysis genes in A. westerdijkiae, reducing the generation of secondary metabolite precursors such as NRPS and PKS, thereby inhibiting OTA biosynthesis. On grapes, L. brevis 8–2B could inhibit the infection of A. westerdijkiae, and prolong its shelf life. This study provides new insights for the research and development of novel agent to control OTA contamination.