Selective attention is a fundamental cognitive function that uses top-down signals to orient and prioritize information processing in the brain. Single-cell recordings from behaving monkeys have revealed a number of attention-induced effects on sensory neurons, and have given rise to contrasting viewpoints about the neural underpinning of attentive processing. Moreover, there is evidence that attentional signals originate from the prefrontoparietal working memory network, but precisely how a source area of attention interacts with a sensory system remains unclear. To address these questions, we investigated a biophysically based network model of spiking neurons composed of a reciprocally connected loop of two (sensory and working memory) networks. We found that a wide variety of physiological phenomena induced by selective attention arise naturally in such a system. In particular, our work demonstrates a neural circuit that instantiates the “feature-similarity gain modulation principle,” according to which the attentional gain effect on sensory neuronal responses is a graded function of the difference between the attended feature and the preferred feature of the neuron, independent of the stimulus. Furthermore, our model identifies key circuit mechanisms that underlie feature-similarity gain modulation, multiplicative scaling of tuning curve, and biased competition, and provide specific testable predictions. These results offer a synthetic account of the diverse attentional effects, suggesting a canonical neural circuit for feature-based attentional processing in the cortex.