His advice is not binding, but the BBC reports ECJ judges generally followed the advocate's lead.
The finding involves the case of Romanian national Adrian Coman and his American partner, Clai Hamilton, who tied the knot in Brussels in 2010 but have since been denied the right to live in Romania together.
So while the 28 EU countries "are free to provide or not for marriage for persons of the same sex", they must not limit their application of spousal rights in a way that infringes "on the right of citizens of the Union and their family members to move and reside freely within the territory of the Member States", Wathelet wrote.
Accordingly, such a person may also reside on a permanent basis in the territory of the Member State in which his or her spouse is established as an European Union citizen after exercising his or her freedom of movement. Romania, which does not allow same-sex marriages, refused.
"Starting this litigation, we realized that we had to take it to the end, whatever the end was", Mr. Coman said in an interview in November, when the European court, based in Luxembourg, began examining the case.
The gay couple, alleging discrimination on the basis of sexual orientation, challenged the decision of Romanian authorities.
The EU directive on the issue, Mr Wathelet added, made no reference to member state law in order to determine the nature of "spouse". It will also ensure the term "spouse" is always seen as gender neutral by law.
However, the Romanian authorities refused to grant Mr Hamilton that right of residence on the ground, inter alia, that he could not be classified in Romania as the "spouse" of an European Union citizen, that member state not recognising same-sex marriage.
Melchior Wathelet, who is a Belgian advocate in the court, said that the new rules will ensure that the rights of individuals are always upheld.
It was his opinion that "in view of the general evolution of the societies of the member states of the EU in the last decade in the area of authorisation of same-sex marriage" it was no longer appropriate to follow the case law definition of marriage as "a union between two persons of the opposite sex". Like Romania, Poland, Slovakia, Bulgaria, Lithuania and Latvia do not give same-sex couples any legal rights or responsibilities.
"This is fantastic news and a landmark opinion for rainbow families", Sophie in 't Veld, the Dutch member of the European Parliament, told The Guardian.
"Granting the spouse of a union citizen a right of residence constitutes recognition and the minimum guarantee that can be given them", the opinion concludes. The EU has insisted that any future agreements on citizens' rights and access to the single market must continue to be policed by the ECJ.