The five-bar mechanism is popularly applied to generate abundant planar trajectories. This paper studied the fivebar mechanism driven by a pair of noncircular gears to generate a specific path. The pivot of the two coupler links on the mechanism tracing the "∞" path is illustrated as the example. To follow the required path, the two input links of the five-bar mechanism must have a special relationship of angular displacement. The pitch curves of the noncircular gears can thus be synthesized to satisfy the relationship by the principle of synthesis. The systemic design method can be applied in other types of path generations.