Synchronization plays an important role in most of the neuronal activities and in particular in the control of the motor system. However, due to biochemical dysfunction in the brain activity, an abnormal and excessive synchronization may occur being responsible for severe symptoms of several neurological diseases. For the case of Parkinson's disease, for instance, an insufficient dopamine production in the basal ganglia causes rigidity or continuous tremors. In the case of epilepsy instead, for still unknown reasons strong unpredictable seizures often occur. Based on this evidence as an alternative to oral medication, several neurostimulation techniques have been developed with the aim to control and relieve the symptoms. In the same vein, we here propose a new method which has the property of being as less invasive as possible while controlling the symptoms. It is based on the consideration that the neuronal patches resemble a set of phase-coupled oscillators which dynamics can be described by the celebrated Kuramoto model. The control technique we employ is inspired by a Hamiltonian formulation of such model. To verify the effectiveness of our method, we test it in a more realistic model of coupled neurons as prescribed by the Stuart-Landau equations. The numerical simulations validate our approach (see Figure, blue uncontrolled and red controlled).