In her ruling, Judge Jackson appeared to respond to Mr. Cooper’s notion. She wrote that the law required not just Mr. McGahn, but also “other current and former senior-level White House officials” who receive a subpoena to appear — and that it made no difference if they worked on domestic or national security matters.

Still, she emphasized, her ruling is only about whether Mr. McGahn must show up to be asked questions. It leaves unanswered whether the questions that lawmakers want to ask him — primarily about conversations with Mr. Trump detailed in the Mueller report — are subject to executive privilege, suggesting that even if Congress ultimately wins a Supreme Court ruling forcing Mr. McGahn to show up, the litigation process might have to start all over again.

The House Judiciary Committee subpoenaed Mr. McGahn in May after the release of the report by the special counsel, Robert S. Mueller III. It showed that Mr. McGahn was a key witness to several of the most serious episodes in which Mr. Trump sought to obstruct the Russia investigation.

But Mr. Trump, who had openly vowed to block “all” oversight subpoenas after Democrats took control of the House in the 2018 midterm election, instructed Mr. McGahn not to cooperate.

In August, the House Judiciary Committee sued Mr. McGahn, seeking a judicial order that he comply with the subpoena. That same day, the panel also asked a judge for an order permitting it to see secret grand jury evidence gathered by Mr. Mueller, which Attorney General William P. Barr declined to provide to Congress. (Another federal judge ruled for Congress in the grand jury case a month ago, but the administration has appealed.)

The court filings said the House needed the information not just for oversight purposes, but also for an impeachment inquiry. While the impeachment focus has since shifted to the Ukraine affair that burst into public view in September, House Democrats are still considering an article of impeachment that would accuse Mr. Trump of obstruction of justice.

A question pervading both disputes is whether the Constitution permits Congress to subpoena aides to a president like Mr. McGahn and, potentially, Mr. Bolton, to talk about their official duties — or whether the president’s secrecy powers make his aides absolutely immune from such subpoenas.