Many endophytic fungi have been found to synthesize bioactive compounds to defend host plants against pathogenic organisms. Here we performed anti-fungal bioassay of 80 endophytic fungi isolated from Ginkgo biloba. Fifteen endophytes were active against at least one of the selected fungi, Fusarium graminearum, Sclerotinia sclerotiorum and Phytophthora capsici, using the agar diffusion method. The most bioactive strain CDW7 was identified as Chaetomium globosum by microscopic examination and ITS rRNA gene sequence data. Culture broth of CDW7 diluted 3-fold completely inhibited the mycelial growth and conidia germination of F. graminearum in vitro. Therefore, Fusarium head blight, a common disease in wheat and barley associated with Fusarium spp., was used to test the anti-phytopathogenic activity in vivo. The fermentation broth of CDW7 resulted in a protective efficacy of 54.9% and curative efficacy of 48.8%. Followed by a bioassay-guided approach, 1,2-benzenedicarboxaldehyde-3,4,5-trihydroxy-6-methyl (flavipin) was isolated and demonstrated to significantly inhibit the growth of several plant-pathogenic fungi, especially F. graminearum with an EC50 value of 0.73 μg mL−1 comparable to the commonly used fungicide carbendazim, indicating that it could be used as a fungicide or as a lead compound of new fungicides.