Sensory areas of the mammalian neocortex are thought to act as distribution hubs, transmitting information about the external environment to various cortical and subcortical structures in order to generate adaptive behavior. However, the exact role of cortical circuits in sensory perception remains unclear. Within primary visual cortex (V1), various populations of pyramidal neurons (PNs) send axonal projections to distinct targets, suggesting multiple cellular networks that may be independently engaged during the generation of behavior. Here, we investigated whether PN subpopulations differentially support sensory-guided performance by training mice in a visual detection task based on eyeblink conditioning. Applying 2-photon calcium imaging and optogenetic manipulation of anatomically-defined PNs in behaving animals, we show that layer 5 corticopontine neurons strongly encode task information and are selectively necessary for performance. These results contrast with recent observations of operant behavior showing a limited role for the neocortex in sensory detection. Instead, our findings support a model in which target-specific cortical subnetworks form the basis for adaptive behavior by directing relevant information to downstream brain areas. Overall, this work highlights the potential for neurons to form physically interspersed but functionally segregated networks capable of parallel, independent control of perception and behavior.