Bacterial polyynes are highly active natural products with a broad spectrum of antimicrobial activities. However, their detailed mechanism of action remains unclear. By integrating comparative genomics, transcriptomics, functional genetics, and metabolomics analysis, we identified a unique polyyne resistance gene, masL (encoding acetyl-CoA acetyltransferase), in the biosynthesis gene cluster of antifungal polyynes (massilin A 1, massilin B 2, collimonin C 3, and collimonin D 4) of Massilia sp. YMA4. Crystallographic analysis indicated that bacterial polyynes serve as covalent inhibitors of acetyl-CoA acetyltransferase. Moreover, we confirmed that the bacterial polyynes disrupted cell membrane integrity and inhibited cell viability of Candida albicans by targeting ERG10, the homolog of MasL. Thus, this study demonstrated that acetyl-CoA acetyltransferase is a potential target for the development of antifungal agents.