The skin comprises tissue macrophages as the most abundant resident immune cell type. Their diverse tasks including resistance against invading pathogens, attraction of bypassing immune cells from vessels, and tissue repair require dynamic specification. Here, we delineated the postnatal development of dermal macrophages and their differentiation into subsets by adapting single-cell transcriptomics, fate mapping, and imaging. Thereby we identified a phenotypically and transcriptionally distinct subset of prenatally seeded dermal macrophages that self-maintained with very low postnatal exchange by hematopoietic stem cells. These macrophages specifically interacted with sensory nerves and surveilled and trimmed the myelin sheath. Overall, resident dermal macrophages contributed to axon sprouting after mechanical injury. In summary, our data show long-lasting functional specification of macrophages in the dermis that is driven by stepwise adaptation to guiding structures and ensures codevelopment of ontogenetically distinct cells within the same compartment.