Directional mechanoreception by hair cells is transmitted to the brain via afferent neurons to enable postural control and rheotaxis. Neuronal tuning to individual directions of mechanical flow occurs when each peripheral axon selectively synapses with multiple hair cells of identical planar polarization. How such mechanosensory labeled lines are established and maintained remains unsolved. Here, we use the zebrafish lateral line to reveal that asymmetric activity of the transcription factor Emx2 diversifies hair cell identity to instruct polarity-selective synaptogenesis. Unexpectedly, presynaptic scaffolds and coherent hair cell orientation are dispensable for synaptic selectivity, indicating that epithelial planar polarity and synaptic partner matching are separable. Moreover, regenerating axons recapitulate synapses with hair cells according to Emx2 expression but not global orientation. Our results identify a simple cellular algorithm that solves the selectivity task even in the presence of noise generated by the frequent receptor cell turnover. They also suggest that coupling connectivity patterns to cellular identity rather than polarity relaxes developmental and evolutionary constraints to innervation of organs with differing orientation.