Receptive fields (RFs) of cortical sensory neurons increase in size along consecutive processing stages. When multiple stimuli are present in a large visual RF, a neuron typically responds to an attended stimulus as if only that stimulus were present. However, the mechanism by which a neuron selectively responds to a subset of its inputs while discarding all others is unknown. Here, we show that neurons can switch between subsets of their afferent inputs by highly specific modulations of interareal gamma-band phase-coherence (PC). We measured local field potentials, single- and multi-unit activity in two male macaque monkeys (Macaca mulatta) performing an attention task. Two small stimuli were placed on a screen; the stimuli were driving separate local V1 populations, while both were driving the same local V4 population. In each trial, we cued one of the two stimuli to be attended. We found that gamma-band PC of the local V4 population with multiple subpopulations of its V1 input was differentially modulated. It was high with the input subpopulation representing the attended stimulus, while simultaneously it was very low between the same V4 population and the other input-providing subpopulation representing the irrelevant stimulus. These differential modulations, which depend on stimulus relevance, were also found in the locking of spikes from V4 neurons to the gamma-band oscillations of the V1 input subpopulations. This rapid, highly specific interareal locking provides neurons with a powerful dynamic routing mechanism to select and process only the currently relevant signals.