Species can either maintain a certain social organization in different habitats or show different social organizations in similar habitats. The reasons underlying this variability are not always clear but might have consequences for population dynamics, especially under changing environmental conditions. Among mammals, the primate genus Microcebus lives in small groups of closely related females, derived from female philopatry and dispersed males, as illustrated by the well-studied Microcebus murinus. Here, we studied the genetic structure of a population of the congeneric Microcebus griseorufus, inhabiting three adjacent habitats with different resource availabilities. In order to learn more about the plasticity of the species’ social organization under these different conditions, we analyzed the spatial arrangement of mitochondrial haplotypes of 122 individuals. The study revealed high haplotype diversity and a pronounced difference in spatial distribution between the sexes. Females exhibited spatial aggregation of haplotypes, suggesting a system of female philopatry and matrilines, similar to M. murinus. Male haplotypes were dispersed, and males were more likely to carry rare haplotypes, indicating higher dispersal activity. These findings hint towards the unity of the social organization across the genus Microcebus, suggesting a phylogenetic origin of the social organization. Yet, with decreasing resources, the clustering of female haplotypes declined and approached a random distribution in the marginal habitat, with cluster sizes correlating with resource availability as predicted by the socioecological model. Our study supports the notion that social organization is shaped by both phylogenetic origin and ecological conditions, at least in these small primates.Significance statementImpacts of habitat degradation are mostly described in terms of changes in population densities in relation to the reduction of resources. This neglects the possible effects of altered social organizations due to declining resources or population densities. Using a genetic sampling of three subpopulations of mouse lemurs in Madagascar along a gradient of food availability up to the limit of the species’ ecological tolerance, we show that their social organization consisting of spatial clusters of closely related females and overdispersed males converges towards random spatial distributions of both sexes with declining food availability.