Acetylation of lysine 16 on histone H4 (H4K16ac) is catalyzed by histone acetyltransferase KAT8 and can prevent chromatin compaction in vitro. Although extensively studied in Drosophila, the functions of H4K16ac and two KAT8-containing protein complexes (NSL and MSL) are not well understood in mammals. Here, we demonstrate a surprising complex-dependent activity of KAT8: it catalyzes H4K5ac and H4K8ac as part of the NSL complex, whereas it catalyzes the bulk of H4K16ac as part of the MSL complex. Furthermore, we show that MSL complex proteins and H4K16ac are not required for cell proliferation and chromatin accessibility, whereas the NSL complex is essential for cell survival, as it stimulates transcription initiation at the promoters of housekeeping genes. In summary, we show that KAT8 switches catalytic activity and function depending on its associated proteins and that, when in the NSL complex, it catalyzes H4K5ac and H4K8ac required for the expression of essential genes.