Abstract Background Goji (Lycium barbarum) is an important economic crop that is widely cultivated in Northwest China and is known as superfood. Goji plants are often affected by powdery mildew (Arthrocladiella mougeotii) in the field, resulting in considerable reduction in production and serious economic losses. The long-term reliance on agricultural chemicals to control powdery mildew not only leads to environmental pollution, but also causes excessive residues to accumulate in fruits, endangering human health. The plant epicuticular wax is the first physical barrier between land plants and the atmospheric environment, and plays an important role in the interactions of plants with pathogenic microorganisms. However, the relationship between epicuticular wax and powdery mildew resistance in goji plants is not well understood. Results The leaf epicuticular wax crystals of ‘Ningqi I’ goji were dense and small, and the wax load was 121.74 μg/cm2, which was 3.36 times greater than that of ‘Huangguo’ goji. The ratio of alcohol components in ‘Ningqi I’ goji was 121.18% greater than that in ‘Huangguo’ goji. The incidence rate and disease index of ‘Ningqi I’ goji inoculated with powdery mildew were significantly lower than those inoculated ‘Huangguo’ goji, showing high resistance and moderate susceptibility, respectively. After mechanical wax removal, the disease indices of the two goji varieties increased significantly, indicating extreme susceptibility. Seventeen differential expression genes showing significantly greater expression in ‘Ningqi’ goji leaves than in ‘Huangguo’ goji leaves were enriched in genes involved in fatty acid elongation and the wax biosynthesis pathway. The FAR activity and relative expression levels of LbaFAR and LbaWSD1 in ‘Ningqi I’ goji were significantly greater than those in ‘Huangguo’ goji. The relative expression levels of these genes significantly increased in the overexpression tobacco lines FAR-OE and WSD1-OE, and the wax load were augmented by 46.10% and 22.23%, respectively. Conclusions The increased expression of the LbaFAR and LbaWSD1 genes in ‘Ningqi I’ leaves led to increased FAR and WSD1 activity, increasing the wax load and alcohol content of the epicuticular of leaves, and improving leaf glossiness, resulting in strengthened resistance to powdery mildew. Therefore, the production of leaf epicuticular wax mediated by the LbaFAR and LbaWSD1 genes could be the main reason for the difference in powdery mildew resistance between the two goji varieties, which can provide a theoretical basis for the selection of resistant varieties to control goji powdery mildew. Graphical Abstract