We show that neurons that underlie rhythmic patterns of electrical output may be identified by optical imaging and frequency-domain analysis. Our contrast agent is a two-component dye system in which changes in membrane potential modulate the relative emission between a pair of fluorophores. We demonstrate our methods with the circuit responsible for fictive swimming in the isolated leech nerve cord. The output of a motor neuron provides a reference signal for the phase-sensitive detection of changes in fluorescence from individual neurons in a ganglion. We identify known and possibly novel neurons that participate in the swim rhythm and determine their phases within a cycle. A variant of this approach is used to identify the postsynaptic followers of intracellularly stimulated neurons.