Brain circuits process information through specialized neuronal subclasses interacting within a network. Revealing their interplay requires activating specific cells while monitoring others in a functioning circuit. Here we use a new platform for two-way light-based circuit interrogation in visual cortex in vivo to show the computational implications of modulating different subclasses of inhibitory neurons during sensory processing. We find that soma-targeting, parvalbumin-expressing (PV) neurons principally divide responses but preserve stimulus selectivity, whereas dendrite-targeting, somatostatin-expressing (SOM) neurons principally subtract from excitatory responses and sharpen selectivity. Visualized in vivo cell-attached recordings show that division by PV neurons alters response gain, whereas subtraction by SOM neurons shifts response levels. Finally, stimulating identified neurons while scanning many target cells reveals that single PV and SOM neurons functionally impact only specific subsets of neurons in their projection fields. These findings provide direct evidence that inhibitory neuronal subclasses have distinct and complementary roles in cortical computations.