The cuticular exoskeleton of arthropods is a composite material comprising well-separated layers that differ in function and molecular constituents. Epidermal cells secrete these layers sequentially, synthesizing components of distal cuticle layers before proximal ones. Could the order of synthesis and secretion be sufficient to account for the precision with which cuticle components localize to specific layers? We addressed this question by studying the spatial restriction of melanization in the Drosophila wing. Melanin formation is confined to a narrow layer within the distal procuticle. Surprisingly, this tight localization depends on the multi-ligand endocytic receptor Megalin (Mgl). Mgl acts, in part, by promoting endocytic clearance of Yellow. Yellow is required for black melanin formation, and its synthesis begins as cuticle is secreted. Near the end of cuticle secretion, its levels drop precipitously by a mechanism that depends on Mgl and Rab5-dependent endocytosis. In the absence of Mgl, Yellow protein persists at higher levels and melanin granules form ectopically in more proximal layers of the procuticle. We propose that the tight localization of the melanin synthesis machinery to the distal procuticle depends not only on the timing of its synthesis and secretion, but also on the rapid clearance of these components before synthesis of subsequent cuticle layers.