BRUSSELS—An adviser to the European Union’s top court said Thursday Hamas and the Tamil Tigers should be taken off the EU’s terror list, because the bloc’s governments followed the wrong procedures when including the two groups.

The opinion of the European Court of Justice’s advocate general isn’t binding on the courts judges. However, if confirmed, it would mark a key point in a drawn-out court battle between the Palestinian and Sri Lankan groups and EU governments.

Depending...