NEW YORK, Nov 4 (Reuters) - President Donald Trump's longtime accounting firm must hand over eight years of his tax returns to New York prosecutors, a U.S. appeals court ruled Monday in the latest setback for Trump in his tenacious efforts to keep his finances secret.

The ruling by the New York-based 2nd U.S. Circuit Court of Appeals backed the ability of prosecutors to enforce a subpoena for the returns against accounting firm Mazars LLP. With the Republican president set to appeal, the ruling sets the stage for an expected showdown at the U.S. Supreme Court, whose 5-4 conservative majority includes two justices appointed by Trump. (Reporting By Brendan Pierson in New York Editing by Will Dunham and Chizu Nomiyama)