Hybrid sterility of the heterogametic sex is one of the first postzygotic reproductive barriers to evolve during speciation, yet the molecular basis of hybrid sterility is poorly understood. We show that the hybrid male sterility gene Odysseus-site homeobox (OdsH) encodes a protein that localizes to evolutionarily dynamic loci within heterochromatin and leads to their decondensation. In Drosophila mauritiana x Drosophila simulans male hybrids, OdsH from D. mauritiana (OdsHmau) acts as a sterilizing factor by associating with the heterochromatic Y chromosome of D. simulans, whereas D. simulans OdsH (OdsHsim) does not. Characterization of sterile hybrid testes revealed that OdsH abundance and localization in the premeiotic phases of spermatogenesis differ between species. These results reveal that rapid heterochromatin evolution affects the onset of hybrid sterility.