The notion of recording neural activity and using it to guide electrical stimulation is a concept that is pervasive across ongoing efforts to modulate brain function. In particular, electroencephalography (EEG) and transcranial electrical stimulation (TES) are linked by a long-standing reciprocity principle which, despite being known for over a century, has not led to a formalism for rationally performing EEG-TES. Here we formulate the EEG and TES forward problems as a pair of linear systems with a common transfer matrix. We employ this dual formulation to derive a least-squares solution to the TES montage that generates an electric field most closely matched to the underlying activation pattern. We show that this can be performed without explicitly localizing the sources of activity. Boundary-element model (BEM) simulations using a realistic head model are then used to validate the formulation and to demonstrate that reciprocal TES guides the electric field to the location and orientation of the measured activity. These results have application to a host of clinical and research applications in which one seeks to modulate the sources of observed neural activity.