The gain, loss or modification of morphological traits is generally associated with changes in gene regulation during development. However, the molecular bases underlying these evolutionary changes have remained elusive. Here we identify one of the molecular mechanisms that contributes to the evolutionary gain of a male-specific wing pigmentation spot in Drosophila biarmipes, a species closely related to Drosophila melanogaster. We show that the evolution of this spot involved modifications of an ancestral cis-regulatory element of the yellow pigmentation gene. This element has gained multiple binding sites for transcription factors that are deeply conserved components of the regulatory landscape controlling wing development, including the selector protein Engrailed. The evolutionary stability of components of regulatory landscapes, which can be co-opted by chance mutations in cis-regulatory elements, might explain the repeated evolution of similar morphological patterns, such as wing pigmentation patterns in flies.