Cocaine acts on neurons that release a specific neurotransmitter called dopamine. Normally, dopamine-containing neurons, like other neurons, communicate using electrical signals and chemical messages. When the presynaptic neuron is stimulated, the action potential travels along the axon to the axon terminal. This triggers the release of dopamine from the neuron into the synaptic space.
The dopamine then binds to dopamine receptors on the postsynaptic neuron and triggers an action potential in that neuron. Dopamine then releases from the receptor into the synaptic space where it is then degraded by enzymes or is carried back into the presynaptic neuron through transporters.
When cocaine is present in the brain, it blocks the transporter proteins that normally carry dopamine back into the presynaptic axon terminal. This causes the amount of dopamine to build up in the synaptic space. The excess dopamine will continue to bind to receptors and stimulate the postsynaptic neuron. Cocaine really does change the way neurons communicate.