Spike-timing-dependent plasticity (STDP) is a general rule of synaptic plasticity based on precise spike timings. The common form of STDP strengthens synaptic weights most when a presynaptic spike time precedes a postsynaptic spike time by a small amount of time. Even though various neural computations can be implemented by STDP, the relation between STDP and synchronous firing remains elusive. With synchrony kept in mind, here we analyze neural networks driven by a pacemaker in the oscillatory scheme. We show that STDP promotes formation of a feedforward network whose root is the pacemaker. Neurons fire slightly after the pacemaker does, and therefore frequency synchrony is achieved. Remarkably, the synaptic weights necessary for frequency synchrony are much smaller with STDP than without STDP.