Natural populations hold enormous potential for evolutionary genetic studies, especially when phenotypic, genetic and environmental data are all available on the same individuals. However, untangling the genotype-phenotype relationship in natural populations remains a major challenge. Here, we describe results of an investigation of one class of phenotype, allele-specific gene expression (ASGE), in the well-studied natural population of baboons of the Amboseli basin, Kenya. ASGE measurements identify cases in which one allele of a gene is overexpressed relative to the alternative allele of the same gene, within individuals, thus providing a control for background genetic and environmental effects. Here, we characterize the incidence of ASGE in the Amboseli baboon population, focusing on the genetic and environmental contributions to ASGE in a set of eleven genes involved in immunity and defence. Within this set, we identify evidence for common ASGE in four genes. We also present examples of two relationships between cis-regulatory genetic variants and the ASGE phenotype. Finally, we identify one case in which this relationship is influenced by a novel gene–environment interaction. Specifically, the dominance rank of an individual’s mother during its early life (an aspect of that individual’s social environment) influences the expression of the gene CCL5 via an interaction with cis-regulatory genetic variation. These results illustrate how environmental and ecological data can be integrated into evolutionary genetic studies of functional variation in natural populations. They also highlight the potential importance of early life environmental variation in shaping the genetic architecture of complex traits in wild mammals.