Morphological novelties are lineage-specific traits that serve new functions. Developmental polyphenisms have been proposed to be facilitators of phenotypic evolution, but little is known about the interplay between the associated genetic and environmental factors. Here, we study two alternative morphologies in the mouth of the nematode Pristionchus pacificus and the formation of teeth-like structures that are associated with bacteriovorous feeding and predatory behaviour on fungi and other worms. These teeth-like denticles represent an evolutionary novelty, which is restricted to some members of the nematode family Diplogastridae but is absent from Caenorhabditis elegans and related nematodes. We show that the mouth dimorphism is a polyphenism that is controlled by starvation and the co-option of an endocrine switch mechanism. Mutations in the nuclear hormone receptor DAF-12 and application of its ligand, the sterol hormone dafachronic acid, strongly influence this switch mechanism. The dafachronic acid-DAF-12 module has been shown to control the formation of arrested dauer larvae in both C. elegans and P. pacificus, as well as related life-history decisions in distantly related nematodes. The comparison of dauer formation and mouth morphology switch reveals that different thresholds of dafachronic acid signalling provide specificity. This study shows how hormonal signalling acts by coupling environmental change and genetic regulation and identifies dafachronic acid as a key hormone in nematode evolution.