A learned sensory-motor behavior engages multiple brain regions, including the neocortex and the basal ganglia. How a target stimulus is detected by these regions and converted to a motor response remains poorly understood. Here, we performed electrophysiological recordings and pharmacological inactivations of whisker motor cortex and dorsolateral striatum to determine the representations within, and functions of, each region during performance in a selective whisker detection task in male and female mice. From the recording experiments, we observed robust, lateralized sensory responses in both structures. We also observed bilateral choice probability and preresponse activity in both structures, with these features emerging earlier in whisker motor cortex than dorsolateral striatum. These findings establish both whisker motor cortex and dorsolateral striatum as potential contributors to the sensory-to-motor (sensorimotor) transformation. We performed pharmacological inactivation studies to determine the necessity of these brain regions for this task. We found that suppressing the dorsolateral striatum severely disrupts responding to task-relevant stimuli, without disrupting the ability to respond, whereas suppressing whisker motor cortex resulted in more subtle changes in sensory detection and response criterion. Together these data support the dorsolateral striatum as an essential node in the sensorimotor transformation of this whisker detection task.SIGNIFICANCE STATEMENT Selecting an item in a grocery store, hailing a cab - these daily practices require us to transform sensory stimuli into motor responses. Many decades of previous research have studied goal-directed sensory-to-motor transformations within various brain structures, including the neocortex and the basal ganglia. Yet, our understanding of how these regions coordinate to perform sensory-to-motor transformations is limited because these brain structures are often studied by different researchers and through different behavioral tasks. Here, we record and perturb specific regions of the neocortex and the basal ganglia and compare their contributions during performance of a goal-directed somatosensory detection task. We find notable differences in the activities and functions of these regions, which suggests specific contributions to the sensory-to-motor transformation process.