Lanosterol 14α-demethylase (CYP51) is an important target in the development of antifungal drugs. The fungal-derived restricticin 1 and related molecules are the only examples of natural products that inhibit CYP51. Here, using colocalizations of genes encoding self-resistant CYP51 as the query, we identified and validated the biosynthetic gene cluster (BGC) of 1. Additional genome mining of related BGCs with CYP51 led to production of the related lanomycin 2. The pathways for both 1 and 2 were identified from fungi not known to produce these compounds, highlighting the promise of the self-resistance enzyme (SRE) guided approach to bioactive natural product discovery.