Complex vocal communication requires precise, flexible adjustments to vocal-motor commands for the production of coherent responses to auditory inputs. The mechanisms underlying how such sensorimotor integration controls vocal production is poorly understood. Here, we investigate the dynamics of territorial vocal duels and song-matching in common nightingales (Luscinia megarhynchos). Using a combination of field observations, playback experiments and accelerometry, we find that wild nightingales readily modified the acoustic features of their song, matched the rival\'s song and engaged more vigorously against vocal opponents with a shared song repertoire. Furthermore, we demonstrate that neurons in the sensorimotor nucleus HVC are tuned to specific song stimuli, potentially enabling context-specific integration of auditory information to facilitate matched song production. These findings highlight the crucial role of song recognition in allowing nightingales to adjust their vocalizations in response to specific social situations, demonstrating the complexity and adaptability of their communication system. Moreover, this study provides a new framework and model system for investigating online sensorimotor processing during dynamic vocal interactions.