The Dutch website Geenstijl, operated by GS Media, had posted links to an Australian site that was hosting photographs from Playboy.
But the court ruled GS Media had broken copyright rules, in part because it was motivated by profit.
GS Media said this was a blow to the "free internet".
Playboy's publisher, Sanoma, first brought the case against GS Media over links to photos of Dutch TV personality Britt Dekker, in 2011.
In April 2016, EU advocate general Melchior Wathelet sided with GS Media, arguing in his legal opinion to the court that posting the hyperlinks did not constitute copyright infringement.
But now the court has ruled that  GS Media's posting of the links was a "communication to the public" - making it subject to the stated checks and balances regarding copyright.
It said the internet was "of particular importance to freedom of expression and of information and that hyperlinks contribute to its sound operation" - but added that certain parties had a greater responsibility to avoid posting links to illegally published content.
"[W]hen hyperlinks are posted for profit, it may be expected that the person who posted such a link should carry out the checks necessary to ensure that the work concerned is not illegally published," it said.
In a statement on its website, Geenstijl said that not being able to hyperlink in a "free and unsolicited way" would make it harder for websites to report on newsworthy events.
"The struggle for the survival of the free internet with hyperlinks included today suffered a heavy blow," the statement read.
"But we're not giving up. Because we'll fight on for freedom of the press, in this case and beyond."
The European Court of Justice has ruled in favour of Playboy in a long-running case over hyperlinks to copyrighted content.