Male secondary sexual traits and female mate choice traits must contain heritable variation for sexual selection to operate. However, for female mate choice, especially, this is poorly known. To complicate matters, both male sexual traits and female mate choice typically show condition dependence, implying that environmental effects probably play an important synergistic role. Using a cross-fostering design, we therefore aimed to disentangle genetic, environmental and their potential interacting effects to investigate how they affect the expression of a sexually selected trait (here birdsong) and female mate choice. To assess environmental effects, we focused on the role of the social environment and thus on learned components. Among the different male song traits investigated, we found a high heritability for song bout length and song bout repertoire, as well as an intriguing gene-by-environment interaction for song bout repertoire. Specifically, the tutor appeared to negatively affect the song bout repertoire of the tutee when his genetic father had a large song bout repertoire but had a positive effect on descendants from fathers with small song bout repertoires. In contrast, we did not detect significant heritability in female mate choice. Female mate choice contained a learned component as females significantly disfavoured their foster father in the mate choice tests, indicating a learned inbreeding avoidance. Thus, our study provides important insights into the role of the social environment for both birdsong and female mate choice. However, the absence of a heritable component in female mate choice suggests a need for studies investigating the heritability of female preferences for (heritable) male song traits in order to gain a better understanding of a potential coevolution between male sexual traits and female mate choice. Overall, our results suggest that indirect genetic effects acting during the pre- and postfledging social contexts may play a prominent role in sexual selection. (C) 2017 The Association for the Study of Animal Behaviour. Published by Elsevier Ltd. All rights reserved.