Official data put Yes on 50.42% and No on 49.58% on Monday morning, with over 99% of votes counted.
Moldovan media said many of the votes yet to be counted had been cast abroad and would likely lean towards Yes, as the Moldovan diaspora is broadly in favour of closer ties with the EU.
As well as the referendum on changing the constitution, Moldovans also voted in the country's presidential election on Sunday.
Sandu took 42% of the presidential vote, while her main rival, former prosecutor-general Alexandr Stoianoglo, won 26%, a stronger result than polls had predicted.
The result sets the scene for a tightly fought run-off between the two on Nov 3. Stoianoglo has said that, if elected, he would build a “balanced” foreign policy involving ties with the EU, the United States, Russia, and China.