Short answer. Yes, but through a formal easement and with payment. Article 639 lets someone who needs a dam to divert or take water build one that rests on banks he does not own, by establishing the easement of abutment of a dam — but only after paying the owner the proper indemnity for the burden.
What the law says
he may establish the easement of abutment of a dam, after payment of the proper indemnity.
Civil Code, Article 639 — Compulsory Easement of Aqueduct for Diversion. Read the full provision →
A right the law grants for water use
The article addresses exactly your problem: you need a dam, but the banks that must support it belong to your neighbour. It provides that where, to divert or take water from a river or stream, it is necessary to build a dam, and the builder is not the owner of the banks or lands that must support it, he may establish the easement of abutment of a dam, after payment of the proper indemnity. The law recognises that water often cannot be used without leaning the structure on another's land, and so it supplies a legal route to do that — an easement — rather than leaving you to trespass or to abandon the project.
Necessity is the trigger
This is not a free-standing right to build on a neighbour's bank whenever convenient. The article ties the easement to a genuine need connected to using water — the diversion or taking of water from a river, brook or other stream — where constructing the dam is necessary and the supporting banks are not yours. The requirement of necessity keeps the burden on the neighbour proportionate to a real purpose. If the dam is not actually needed to take or divert the water, or if you could achieve it on your own land, the justification for imposing the easement weakens correspondingly.
Indemnity is not optional
The right comes at a price. The article expressly conditions the easement on payment of the proper indemnity. Your neighbour is not expected to donate his bank to your project; he is entitled to be compensated for the burden the abutment places on his land. So the easement and the indemnity go together — establishing the one requires answering for the other. This reflects a general principle running through compulsory easements: the law will subordinate one owner's land to another's legitimate need, but it insists that the served party pay for the servitude he imposes.
What the easement does not give you
The easement lets your dam rest on the neighbour's bank; it does not make you the owner of that bank, and it does not license you to cause unnecessary damage beyond what the abutment genuinely requires. It is a burden on the neighbour's land for a defined purpose, not a transfer of the land itself. The article also does not, by itself, resolve your right to the water — permission to take or divert water is governed by its own body of rules. And whether the necessity, the extent and the indemnity are appropriate are practical questions that turn on the specific site and project.