Fungi colonizing plants are gaining attention because of their ability to promote plant growth and suppress pathogens. While most studies focus on endosymbionts from grasses and legumes, the large and diverse group of ericaceous plants has been much neglected. We recently described one of the very few fungal endophytes promoting the growth of the Ericaceae Vaccinium macrocarpon (American cranberry), notably the Codinaeella isolate EC4. Here, we show that EC4 also suppresses fungal pathogens, which makes it a promising endophyte for sustainable cranberry cultivation. By dual-culture assays on agar plates, we tested the potential growth suppression (or biocontrol) of EC4 on other microbes, notably 12 pathogenic fungi and one oomycete reported to infect not only cranberry but also blueberry, strawberry, tomato plants, rose bushes and olive trees. Under greenhouse conditions, EC4 protects cranberry plantlets infected with one of the most notorious cranberry-plant pathogens, Diaporthe vaccinii, known to cause upright dieback and berry rot. The nuclear genome sequence of EC4 revealed a large arsenal of genes potentially involved in biocontrol. About ∼60 distinct clusters of genes are homologs of secondary metabolite gene clusters, some of which were shown in other fungi to synthesize nonribosomal peptides and polyketides, but in most cases, the exact compounds these clusters may produce are unknown. The EC4 genome also encodes numerous homologs of hydrolytic enzymes known to degrade fungal cell walls. About half of the nearly 250 distinct glucanases and chitinases are likely involved in biocontrol because they are predicted to be secreted outside the cell. Transcriptome analysis shows that the expression of about a quarter of the predicted secondary-metabolite gene clusters and glucan and chitin-degrading genes of EC4 is stimulated when it is co-cultured with D. vaccinii. Some of the differentially expressed EC4 genes are alternatively spliced exclusively in the presence of the pathogen, altering the proteins’ domain content and subcellular localization signal, thus adding a second level of proteome adaptation in response to habitat competition. To our knowledge, this is the first report of Diaporthe-induced alternative splicing of biocontrol genes.