The NADH:NAD+ ratio is the primary indicator of the metabolic state of bacteria. NAD(H) homeostasis is critical for Mycobacterium tuberculosis (Mtb) survival and is thus considered an important drug target, but the spatio-temporal measurements of NAD(H) remain a challenge. Genetically encoded fluorescent biosensors of the NADH:NAD+ ratios were recently described, paving the way for investigations of the metabolic state of pathogens during infection. Here we have adapted the genetically encoded biosensor Peredox for measurement of the metabolic state of Mtb in vitro and during infection of macrophage cells. Using Peredox, here we show that inhibition of the electron transport chain, disruption of the membrane potential and proton gradient, exposure to reactive oxygen species and treatment with antimycobacterial drugs led to the accumulation of NADH in mycobacterial cells. We have further demonstrated that Mtb residing in macrophages displays higher NADH:NAD+ ratios, that may indicate a metabolic stress faced by the intracellular Mtb. We also demonstrate that the Mtb residing in macrophages display a metabolic heterogeneity, which may perhaps explain the tolerance displayed by intracellular Mtb. Next we studied the effect of immunological modulation by interferon gamma on metabolism of intracellular Mtb, since macrophage activation is known to restrict mycobacterial growth. We observed that activation of resting macrophages with interferon-gamma results in higher NADH:NAD+ levels in resident Mtb cells. We have further demonstrated that exposure of Isoniazid, Bedaquiline, Rifampicin, and O-floxacin results in higher NADH:NAD+ ratios in the Mtb residing in macrophages. However, intracellular Mtb displays lower NADH:NAD+ ratio upon exposure to clofazimine. In summary, we have generated reporter strains capable of measuring the metabolic state of Mtb cells in vitro and in vivo with spatio-temporal resolution. We believe that this tool will facilitate further studies on mycobacterial physiology and will create new avenues of research for anti-tuberculosis drug discovery.