The result of cortical processing is routed to different downstream targets via distinct pathways – broadly, cortico-cortical and cortico-subcortical. It is as yet unclear what roles these pathways play in perception, and what cellular and circuit mechanisms regulate their gating. I recently showed that activation of the apical dendrites of layer 5 (L5) pyramidal neurons correlates to the threshold for perception (Takahashi et al., 2016). Two distinct classes of L5 neurons target either other cortical areas or subcortical areas. I took advantage of two transgenic mouse lines to determine the relative contribution of these L5 subclasses to the perceptual process. I found that the activation of apical dendrites in neurons of the somatosensory cortex that project to subcortical regions almost exclusively determined the detection of whisker deflections in mice. Moreover, dendritic activation was strongly modulated by behavioral context. These results suggest that dendritic activation drives context-dependent interactions between cortex and subcortical regions that are crucial for perception. During the seminar, I will further discuss my long-term goal to develop a mechanistic understanding of how internal brain states, such as attention and expectation, modulate sensory processing to control perceptual behaviors.