The output of cortical columns is routed to different downstream targets via distinct pathways: cortico-cortical and cortico-subcortical. It is as yet unclear what roles these pathways play in perception, and which cellular and circuit mechanisms regulate their gating. We recently showed that activation of the apical dendrites of layer 5 (L5) pyramidal neurons correlates with the threshold for perception, but these neurons come in two classes that target either other cortical or subcortical areas. In the present study, we took advantage of transgenic mouse lines for these L5 subclasses to determine their relative contributions to the perceptual process. We found that the activation of apical dendrites in neurons of the somatosensory cortex, which project to subcortical regions, almost exclusively determined the detection of tactile stimuli in mice. Our results suggest that dendritic activation drives context-dependent interactions between cortex and subcortical regions, including the higher-order thalamus, superior colliculus and striatum, which are crucial for perception.