Human gamma-herpesviruses, Kaposi's sarcoma herpesvirus (KSHV) and Epstein-Barr virus (EBV) are causally associated to a wide range of cancers. While the default infection program for these viruses is latent, sporadic lytic reactivation supports virus dissemination and oncogenesis. Despite its relevance, the repertoire of host factors governing the transition from latent to lytic phase is not yet complete, leaving much of this complex process unresolved. Here, we show that heat shock factor 2 (HSF2), a transcription factor involved in regulation of acute stress responses and specific cell differentiation processes, promotes gamma-herpesvirus lytic gene expression. In lymphatic endothelial cells infected with KSHV and gastric cancer cells positive for EBV, ectopic HSF2 enhances the expression of lytic genes, while knocking down HSF2 significantly decreases their expression. Mechanistically, HSF2 overexpression results in decreased levels of repressive chromatin histone marks, at the promoters of the master regulators of the oncogenic lytic cascade, KSHV ORF50 and EBV BZLF1. Our results demonstrate that endogenous HSF2 binds to the ORF50 promoter in latent cells and sustains a transcriptionally permissive state. In contrast, in lytic cells, HSF2 occupancy at the ORF50 promoter is lost in conjunction with its proteasomal degradation. These findings establish HSF2 as a conserved regulator of gamma-herpesvirus lytic gene expression in latency and offer new functional insights on the cellular role of HSF2 at target promoters.