Innate resistance to Candida albicans in mucosal tissues requires the production of interleukin-17A (IL-17A) by tissue-resident cells early during infection, but the mechanism of cytokine production has not been precisely defined. In the skin, we found that dermal γδ T cells were the dominant source of IL-17A during C. albicans infection and were required for pathogen resistance. Induction of IL-17A from dermal γδ T cells and resistance to C. albicans required IL-23 production from CD301b+ dermal dendritic cells (dDCs). In addition, we found that sensory neurons were directly activated by C. albicans. Ablation of sensory neurons increased susceptibility to C. albicans infection, which could be rescued by exogenous addition of the neuropeptide CGRP. These data define a model in which nociceptive pathways in the skin drive production of IL-23 by CD301b+ dDCs resulting in IL-17A production from γδ T cells and resistance to cutaneous candidiasis.