In mammals, 5-methylcytosine (5mC) and Polycomb repressive complex 2 (PRC2)-deposited histone 3 lysine 27 trimethylation (H3K27me3) are generally mutually exclusive at CpG-rich regions. As mouse embryonic stem cells exit the naive pluripotent state, there is massive gain of 5mC concomitantly with restriction of broad H3K27me3 to 5mC-free, CpG-rich regions. To formally assess how 5mC shapes the H3K27me3 landscape, we profiled the epigenome of naive and differentiated cells in the presence and absence of the DNA methylation machinery. Surprisingly, we found that 5mC accumulation is not required to restrict most H3K27me3 domains. Instead, this 5mC-independent H3K27me3 restriction is mediated by aberrant expression of the PRC2 antagonist Ezhip (encoding EZH inhibitory protein). At the subset of regions where 5mC appears to genuinely supplant H3K27me3, we identified 163 candidate genes that appeared to require 5mC deposition and/or H3K27me3 depletion for their activation in differentiated cells. Using site-directed epigenome editing to directly modulate 5mC levels, we demonstrated that 5mC deposition is sufficient to antagonize H3K27me3 deposition and confer gene activation at individual candidates. Altogether, we systematically measured the antagonistic interplay between 5mC and H3K27me3 in a system that recapitulates early embryonic dynamics. Our results suggest that H3K27me3 restraint depends on 5mC, both directly and indirectly. Our study also implies a noncanonical role of 5mC in gene activation, which may be important not only for normal development but also for cancer progression, as oncogenic cells frequently exhibit dynamic replacement of 5mC for H3K27me3 and vice versa.