The beet armyworm, Spodoptera exigua, uses (Z,E)-9,12-tetradecadienyl acetate as the major component of its sex pheromone. Previous isotope-labeling experiments demonstrated an unusual ∆12 desaturase activity involved in the biosynthesis of this compound; however, the putative ∆12 desaturase gene has not been reported to date. In the present study, we confirmed this ∆12 desaturation pathway by in vivo labeling experiments, and characterized candidate desaturase genes in a yeast heterologous expression system. We demonstrated that a pheromone gland-specific desaturase, SexiDes5, uses palmitic acid and the subsequently chain-shortened product (Z)-9-tetradecenoic acid as substrates to produce (Z)-11-hexadecenoic and (Z,E)-9,12-tetradecadienoic acids, respectively. In addition, the homologous desaturase SlitDes5 from the congeneric Spodoptera litura had analogous functions.