Animal social behaviour is not static with regard to environmental change. Flexibility in cooperative resource use may be an important response to resource decline, mediating the impacts of resource availability on fitness and demography. In forest ecosystems, hollow trees are key den resources for many species, but are declining worldwide owing to forestry. Altered patterns of den sharing may mediate the effects of the decline of this resource. We studied den-sharing interactions among hollow-dependent Australian mountain brushtail possums to investigate how spatial variation in hollow tree availability affects resource sharing and kin selection. Under reduced den availability, individuals used fewer dens and shared them less often. This suggests increased territoriality in the presence of resource competition. Further, there was a switch from kin avoidance to kin preference with decreasing hollow tree availability. This was driven primarily by a change in den sharing among siblings. The inclusive fitness benefits of den sharing with kin are likely to increase under resource-limiting conditions, but are potentially outweighed by the benefits of associating with non-relatives (avoidance of inbreeding or pathogen transmission) where dens are abundant. We discuss how predictions from social evolutionary theory can contribute to understanding animal responses to landscape change.