Converging evidence suggests that perception involves feedback from higher to primary sensory regions. However, there is as yet no clear explanation for how feedback operates at the mechanistic level. It has been proposed that the action of feedback depends on the active properties of the apical dendrites of pyramidal neurons. Here, we found that Ca2+ activity in the apical dendrites of a subset of layer 5 (L5) pyramidal neurons in primary somatosensory cortex (S1) in mice was correlated with the threshold for perceptual detection of whisker deflections. Manipulating the activity of apical dendrites shifted the perceptual threshold, demonstrating that perceptual process depends critically on activation of the apical dendrites of L5 pyramidal neurons in S1.