C-5 sterol desaturase; part of the third module of ergosterol biosynthesis pathway that includes by the late steps of the pathway (PubMed:18310029). Erg31 and erg32 catalyze the introduction of a C-5 double bond in the B ring to produce 5-dehydroepisterol (By similarity). The third module or late pathway involves the ergosterol synthesis itself through consecutive reactions that mainly occur in the endoplasmic reticulum (ER) membrane. Firstly, the squalene synthase erg9 catalyzes the condensation of 2 farnesyl pyrophosphate moieties to form squalene, which is the precursor of all steroids. Secondly, squalene is converted into lanosterol by the consecutive action of the squalene epoxidase erg1 and the lanosterol synthase erg7. The lanosterol 14-alpha-demethylase erg11/cyp1 catalyzes C14-demethylation of lanosterol to produce 4,4'-dimethyl cholesta-8,14,24-triene-3-beta-ol. In the next steps, a complex process involving various demethylation, reduction and desaturation reactions catalyzed by the C-14 reductase erg24 and the C-4 demethylation complex erg25-erg26-erg27 leads to the production of zymosterol. Erg28 likely functions in the C-4 demethylation complex reaction by tethering erg26 and Erg27 to the endoplasmic reticulum or to facilitate interaction between these proteins. Then, the sterol 24-C-methyltransferase erg6 catalyzes the methyl transfer from S-adenosyl-methionine to the C-24 of zymosterol to form fecosterol. The C-8 sterol isomerase erg2 catalyzes the reaction which results in unsaturation at C-7 in the B ring of sterols and thus converts fecosterol to episterol. The sterol-C5-desaturases erg31 and erg32 then catalyze the introduction of a C-5 double bond in the B ring to produce 5-dehydroepisterol. The C-22 sterol desaturase erg5 further converts 5-dehydroepisterol into ergosta-5,7,22,24(28)-tetraen-3beta-ol by forming the C-22(23) double bond in the sterol side chain. Finally, ergosta-5,7,22,24(28)-tetraen-3beta-ol is substrate of the C-24(28) sterol reductase erg4 to produce ergosterol (PubMed:18310029) (Probable). In the genus Schizosaccharomyces, a second route exists between lanosterol and fecosterol, via the methylation of lanosterol to eburicol by erg6, followed by C14-demethylation by erg11/cyp1 and C4-demethylation by the demethylation complex erg25-erg26-erg27 (PubMed:8586261) (Probable). episterol + 2 Fe(II)-[cytochrome b5] + 2 H(+) + O2 = 5-dehydroepisterol + 2 Fe(III)-[cytochrome b5] + 2 H2O Steroid metabolism; ergosterol biosynthesis. The histidine box domains may contain the active site and/or be involved in metal ion binding. Abolishes the production of ergosterol when erg31 is also deleted (PubMed:18310029). The double disruptant also leads to susceptibility to cycloheximide and to staurosporine, but does not affect tolerance to nystatin and to amphotericin B (PubMed:18310029). In Aspergillus, the biosynthesis pathway of the sterol precursors leading to the prevalent sterol ergosterol differs from yeast. The ringsystem of lanosterol in S.cerevisiae is firstly demethylised in three enzymatic steps leading to the intermediate zymosterol and secondly a methyl group is added to zymosterol by the sterol 24-C-methyltransferase to form fecosterol. In Aspergillus, lanosterol is firstly transmethylated by the sterol 24-C-methyltransferase leading to the intermediate eburicol and secondly demethylated in three steps to form fecosterol. In the genus Schizosaccharomyces, 2 routes exist from lanosterol to erposterol: the classical one via zymosterol and the second one via the formation of eburicol followed by demethylation. Belongs to the sterol desaturase family.