In a fight that pitted Champagne producers against a discount supermarket, the European Union Court of Justice ruled on Wednesday that the retailer can sell its Champagner Sorbet — but only if it can prove that Champagne is a distinct part of its flavor.

The retailer, Aldi, a German discounter, has built its customer base on in-house labels. The sorbet appeared in Aldi’s freezers in December 2012 as part of a limited Christmas promotion. It contained 12 percent Champagne.

But the Champagne producers, who are fiercely protective of their luxury brand, contended that Champagner Sorbet was exploiting the vaunted reputation of Champagne, which comes from a region of France.

The Comité Interprofessionnel du Vin de Champagne, which represents the Champagne producers, said the sorbet did not conform to the specifications required of Champagne products, and so should not be allowed to use that name.