Stem cell research has been focused on niche signaling and epigenetic programming of stem cells. However, epigenetic programming of niche cells remains unexplored. We showed previously that Piwi plays a crucial role in Piwi-interacting RNA-mediated epigenetic regulation and functions in the niche cells to maintain germline stem cells (GSCs) in the Drosophila ovary. To investigate the epigenetic programming of niche cells by Piwi, we screened mutations in the Polycomb and trithorax group genes, and an enhancer of Polycomb and trithorax called corto, for their potential genetic interaction with piwi. corto encodes a chromatin protein. corto mutations restored GSC division in mutants of piwi and fs(1)Yb (Yb), a gene that regulates piwi expression in niche cells to maintain GSCs. Consistent with this, corto appears to be expressed in the niche cells and is not required in the germline. Furthermore, in corto-suppressed Yb mutants, the expression of hedgehog (hh) is restored in niche cells, which is likely responsible for corto suppression of the GSC and somatic stem cell defects of Yb mutants. These results reveal a novel epigenetic mechanism involving Corto and Piwi that defines the fate and signaling function of niche cells in maintaining GSCs.