Fungus-growing termites are engaged in a tripartite mutualism with intestinal microbes and a monocultivar (Termitomyces sp.) in the fungus garden. The termites are often plagued by entomopathogen (Metarhizium anisopliae) and fungus garden is always threatened by competitors (Xylaria spp.). Here, we aim to understand the defensive role of intestinal microbes, the actinomycetes which were isolated from the gut of Macrotermes barneyi. We obtained 44 antifungal isolates, which showed moderate to strong inhibition to Xylaria sp. HPLC analysis indicated that different types of polyenes (tetraene, pentene, and heptaene) existed in the metabolites of 10 strong antifungal Streptomyces strains. Two pentene macrolides (pentamycin and 1′14-dihydroxyisochainin) were firstly purified from Streptomyces strain HF10, both exhibiting higher activity against Xylaria sp. and M. anisopliae than cultivar Termitomyces. Subsequently, tetraene and heptaene related gene disruption assay showed that the mutant strains lost the ability to produce corresponding polyenes, and they also had significantly decreased activities against Xylaria sp. and M. anisopliae compared to that of wild type strains. These results indicate that polyene-producing Streptomyces from the guts of M. barneyi have strong inhibition to competitor fungus and polyenes contribute to inhibitory effects on Xylaria sp.