The ruling in the New York-based 2nd U.S. Circuit Court of Appeals offers another judicial loss for Trump, who has fought off attempts to obtain his financial records, including his tax returns, through multiple lawsuits.
The case is likely destined for the Supreme Court, where the president has already appealed two other lower court decisions requiring the disclosure of his financial records. The court gave Trump's attorneys seven days to bring the matter to the justices.
Trump has defied calls to publicly release his tax records and provided a variety of explanations for his failure to do so. He is the first president in more than 40 years not to voluntarily make his tax records public.
"We believe the subpoena is invalid as issued," Trump's lawyer Jay Sekulow said in a statement. "In light of the Second Circuit decision, we are evaluating our next options including seeking review at the Supreme Court of the United States."
The subpoenas were issued by the Democratic-controlled House Intelligence and Financial Services Committees and seek financial records related to Trump, his businesses and members of his family. The committees have said they are pursuing an investigation into Russian money laundering and other matters.
In May, U.S. District Court Judge Edgardo Ramos ruled that the two banks must comply with subpoenas. Trump appealed Ramos' ruling two days later.
Tuesday's decision was issued by a divided three judge panel made up of two Republican appointees and one Democratic appointee.
Circuit Judge Jon Newman, a Jimmy Carter appointee, wrote in the court's decision that the House committees interest in "pursuing their constitutional legislative function is a far more significant public interest than whatever public interest inheres in avoiding the risk of a Chief Executive's distraction arising from disclosure of documents reflecting his private financial transactions."
Newman also emphasized in the opinion that the issues raised by the lawsuit "do not concern a dispute between the Legislative and Executive Branches" because the subpoenas sought Trump's personal, rather than official, records.
Newman was joined by Circuit Judge Peter Hall, a George W. Bush appointee.
But in a partial dissent, Circuit Judge Debra Ann Livingston, another Bush appointee, rejected that argument, and called the subpoenas "deeply troubling."
"I cannot accept the majority's conclusions that 'this case does not concern separation of powers,' and that there is 'minimal at best' risk of distraction to this and future Presidents from legislative subpoenas of this sort," she wrote.
Livingston said she would send the case back to a lower court and require the House committees to provide more details about the legislative purposes behind their requests before deciding whether the banks must comply.
Deutsche Bank, the president's longtime lender, said Tuesday that it will follow the orders of a court and remained "committed to providing appropriate information to all authorized investigations."
The two related cases already before the Supreme Court involve subpoenas issued to the president's longtime accounting firm Mazars USA.
The justices are likely to decide soon whether to hear the cases. On Thursday, the president's private legal team is expected to submit its formal petition to the top court asking it to review a decision by the federal appeals court in Washington that ordered Mazars to comply with a subpoena issued by the House Oversight Committee.
The justices will meet in private later this month to discuss the petition in the other case, over a subpoena issued to the firm by Manhattan District Attorney Cy Vance, Jr.
Trump's lawyers have argued in multiple lawsuits that the various requests for his financial records have no "legitimate legislative purpose" and are being pursued merely as an attempt to embarrass the president for political gain.
The attorneys have argued that allowing the subpoenas to be enforced could set a dangerous precedent that would allow partisan investigators — either local prosecutors or congressional committees — to saddle presidents with onerous demands for documents and information.
That legal argument has so far failed to sway judges in New York and Washington and was similarly rejected by the three-judge panel in the Second Circuit.