We report the first identification of a sex pheromone in a heliozelid moth, Holocacista capensis van Nieukerken & Geertsema. This leafminer recently infested grapevine in South Africa. Compared to solvent extraction of pheromone glands, solid phase microextraction (SPME) proved to be highly effective for collection of the pheromone from calling females. The volatiles collected by SPME were analyzed by gas chromatography with electroantennographic detection (GC/EAD). Three compounds eliciting electrophysiological activity from the male antenna were identified as (Z)-5-tetradecenal, (Z)-7-tetradecenal, and (Z)-9-hexadecenal by coupled gas chromatography–mass spectrometry (GC/MS). GC/MS analysis of dimethyldisulphide (DMDS) derivatives of fatty acyl moieties in pheromone gland extracts confirmed the presence of the corresponding putative pheromone precursors with double bonds in the same position and with Z geometry. Field trapping experiments in a South African vineyard confirmed that both (Z)-5-tetradecenal and (Z)-7-tetradecenal are essential for the attraction of male H. capensis, whereas addition of (Z)-9-hexadecenal to the blend did not affect the attractiveness. The composition of the pheromone is discussed in relation to the phylogeny of this family of moths.