Despite theoretical justification for the evolution of animal culture, empirical evidence for it beyond mammals and birds remains scant, and we still know little about the process of cultural inheritance. In this study, we propose a mechanism-driven definition of animal culture and test it in the fruitfly. We found that fruitflies have five cognitive capacities that enable them to transmit mating preferences culturally across generations, potentially fostering persistent traditions (the main marker of culture) in mating preference. A transmission chain experiment validates a model of the emergence of local traditions, indicating that such social transmission may lead initially neutral traits to become adaptive, hence strongly selecting for copying and conformity. Although this situation was suggested decades ago, it previously had little empirical support.