IFN-γ is a critical mediator of host defense against Mycobacterium tuberculosis (Mtb) infection. Antigen-specific CD4+ T cells have long been regarded as the main producer of IFN-γ in tuberculosis (TB), and CD4+ T cell immunity is the main target of current TB vaccine candidates. However, given the recent failures of such a TB vaccine candidate in clinical trials, strategies to harness CD4-independent mechanisms of protection should be included in future vaccine design. Here, we have reported that noncognate IFN-γ production by Mtb antigen-independent memory CD8+ T cells and NK cells is protective during Mtb infection and evaluated the mechanistic regulation of IFN-γ production by these cells in vivo. Transfer of arenavirus- or protein-specific CD8+ T cells or NK cells reduced the mortality and morbidity rates of mice highly susceptible to TB in an IFN-γ-dependent manner. Secretion of IFN-γ by these cell populations required IL-18, sensing of mycobacterial viability, Mtb protein 6-kDa early secretory antigenic target-mediated (ESAT-6-mediated) cytosolic contact, and activation of NLR family pyrin domain-containing protein 3 (NLRP3) inflammasomes in CD11c+ cell subsets. Neutralization of IL-18 abrogated protection in susceptible recipient mice that had received noncognate cells. Moreover, improved Mycobacterium bovis bacillus Calmette-Guérin (BCG) vaccine-induced protection was lost in the absence of ESAT-6-dependent cytosolic contact. Our findings provide a comprehensive mechanistic framework for antigen-independent IFN-γ secretion in response to Mtb with critical implications for future intervention strategies against TB.