Although it is accepted that the environment within the granuloma profoundly affects Mycobacterium tuberculosis (Mtb) and infection outcome, our ability to understand Mtb gene expression in these niches has been limited. We determined intragranulomatous gene expression in human-like lung lesions derived from nonhuman primates with both active tuberculosis (ATB) and latent TB infection (LTBI). We employed a non-laser-based approach to microdissect individual lung lesions and interrogate the global transcriptome of Mtb within granulomas. Mtb genes expressed in classical granulomas with central, caseous necrosis, as well as within the caseum itself, were identified and compared with other Mtb lesions in animals with ATB (n = 7) or LTBI (n = 7). Results were validated using both an oligonucleotide approach and RT-PCR on macaque samples and by using human TB samples. We detected approximately 2,900 and 1,850 statistically significant genes in ATB and LTBI lesions, respectively (linear models for microarray analysis, Bonferroni corrected, P < 0.05). Of these genes, the expression of approximately 1,300 (ATB) and 900 (LTBI) was positively induced. We identified the induction of key regulons and compared our results to genes previously determined to be required for Mtb growth. Our results indicate pathways that Mtb uses to ensure its survival in a highly stressful environment in vivo. A large number of genes is commonly expressed in granulomas with ATB and LTBI. In addition, the enhanced expression of the dormancy survival regulon was a key feature of lesions in animals with LTBI, stressing its importance in the persistence of Mtb during the chronic phase of infection.