How synaptic specificity is molecularly coded in target cells is a long-standing question in neuroscience. Whereas essential roles of several target-derived attractive cues have been shown, less is known about the role of repulsion by nontarget cells. We conducted single-cell microarray analysis of two neighboring muscles (M12 and M13) in Drosophila, which are innervated by distinct motor neurons, by directly isolating them from dissected embryos. We identified a number of potential target cues that are differentially expressed between the two muscles, including M13-enriched Wnt4. When the functions of Wnt4, or putative receptors Frizzled 2 and Derailed-2 or Dishevelled were inhibited, motor neurons that normally innervate M12 (MN12s) formed smaller synapses on M12 but instead formed ectopic nerve endings on M13. Conversely, ectopic expression of Wnt4 in M12 inhibits synapse formation by MN12s. These results suggest that Wnt4, via Frizzled 2, Derailed-2, and Dishevelled, generates target specificity by preventing synapse formation on a nontarget muscle. Ectopic expression of five other M13-enriched genes, including beat-IIIc and Glutactin, also inhibits synapse formation by MN12s. These results demonstrate an important role for local repulsion in regulating cell-to-cell target specificity.