The European Court of Justice said that Nestle had to demonstrate the public relied on the shape alone to identify the snack.
The judges concluded this was difficult to prove if goods also showed a brand name such as KitKat.
Rival Cadbury has battled to prevent Nestle obtaining the trademark.
Both Nestle and Cadbury said they were “pleased” with the ruling.
The case will now return to the UK High Court for a final decision.
Nestle claimed that in the 80 years since the chocolate bar was introduced, the four fingers have become almost completely associated with KitKats.
In June, a senior European court lawyer, the advocate-general, disagreed saying such a trademark did not comply with European law.
Nestle has not sought to trademark the two-fingered bar.
Today’s ruling is the latest development in a more than 10-year legal battle between Nestle and Cadbury, which started when Cadbury tried to trademark the purple color it uses on its Cadbury chocolate wrappers.
Nestle objected and finally had the original decision allowing Cadbury to trademark the color overturned in 2013.
Now it would appear Cadbury, which is owned by Mondelez International, has scored a significant but not final victory in the continuing chocolate war.
It has always argued the shape alone was not distinctive enough for consumers to associate it with the rival snack.
A bar called the Kvikk Lunsj, meaning “quick lunch”, launched in Norway in 1937 is available in some UK stores, and although less well known, looks similar to the four-finger KitKat.
A ruling in favor of Nestle would stop other confectionery producers making chocolate bars of the same shape or size.
Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…