Hungary and Poland's court bid to stop EU cash handouts from being conditional on respect for rule of law "should be dismissed".
Budapest and Warsaw took their case to the European Court of Justice.
But, on Thursday, the court's advocate general issued an opinion arguing that their attempt should be thrown out.
The advice of the court precedes a full court decision, which is expected within the coming months.
Linking the disbursement of funds to democratic principles was a key part of the EU’s decision last year to push through a massive subsidy programme for the 27 member nations to overcome the unprecedented impact of the coronavirus pandemic.
Advocate General Manuel Campos Sanchez-Bordona advised the actions of Hungary and Poland “should be dismissed” and argued that the budget-rule of law link was “adopted on an appropriate legal basis ... and respects the principle of legal certainty.”
The court said in a statement that “compliance with the principles of the rule of law may be vitally important for the sound operation of public finances and the proper implementation of the Union budget."
Poland and Hungary have faced criticism in the EU for years over allegations that they have been eroding judicial and media independence, among other democratic principles. The EU had found itself unable to do much to alter the course of either nation and therefore turned to linking money to their adherence to democratic behaviour.
In Hungary, Prime Minister Viktor Orban has been pushing what he calls “illiberal democracy," which his critics say amounts to stifling democracy.
In Poland, the Law and Justice party overwhelmingly dominates government and has also increasingly faced criticism from other EU member nations.
Hungary and Poland initially sought to block the budget because of the introduction of the new mechanism but eventually agreed to the plan on the condition that the European Court of Justice would review it.