Behaviour depends (a) on genes that specify the neural and non-neural elements involved in the perception of and responses to sensory stimuli and (b) on experience that can modulate the fine development of these elements. We exposed transgenic and control Drosophila melanogaster males, and their hybrids, to male siblings during adult development and measured the contribution of genes and of experience to their courtship behaviour. The transgene CheB42a specifically targets male gustatory sensillae and alters the perception of male inhibitory pheromones which leads to frequent male-male interactions. The age at which social experience occurred and the genotype of tester males induced a variable effect on the intensity of male homo- and heterosexual courtship. The strong interaction between the effects of genes and of social experience reveals the plasticity of the apparently stereotyped elements involved in male courtship behaviour. Finally, a high intensity of homosexual courtship was found only in males that simultaneously carried a mutation in their white gene and the CheB42a transgene.