Despite sharing nearly the same genome, individuals within the same species can vary drastically in both morphology and behaviour as a function of developmental stage, sex or developmental plasticity. Thus, regulatory processes must exist that enable the stage-, sex- or environment-specific expression of traits and their integration during ontogeny, yet exactly how trait complexes are co-regulated and integrated is poorly understood. In this study, we explore the developmental genetic basis of the regulation and integration of environment-dependent sexual dimorphism in behaviour and morphology in the horn-polyphenic dung beetle Onthophagus taurus through the experimental manipulation of the transcription factor doublesex (dsx). The gene dsx plays a profound role in the developmental regulation of morphological differences between sexes as well as alternative male morphs by inhibiting horn formation in females but enabling nutrition-responsive horn growth in males. Specifically, we investigated whether experimental downregulation of dsx expression affects male and female aggressive and courtship behaviours in two social contexts: interactions between individuals of the same sex and interactions between males and females. We find that dsx downregulation significantly alters aggressiveness in both males and females, yet does so differently for both sexes as a function of social context: dsxRNAi males exhibited elevated aggression towards males but showed reduced aggression towards females, whereas dsxRNAi females became more aggressive towards males, while their aggressiveness towards other females was unaffected. Moreover, we document unexpectedly high levels of female aggression independent of dsx treatment in both wild-type and control-injected individuals. Lastly, we found no effects of dsxRNAi on courtship and mating behaviours. We discuss the role of dsx in the regulation of sex-specific and plastic behaviours, the unexpectedly high levels of aggression of hornless dsxRNAi males in relation to the well-established description of the hornless sneaker phenotype and the potential ecological function of high female aggression.