Such a law is almost certain to be ruled unconstitutional. The Supremacy Clause of the US Constitution
establishes that the federal constitution, and federal law generally, take precedence over state laws
(the quoted part is from the link).
The Federal government has compelling reasons for keeping tax filings private. For example, it increases voluntary compliance. Since the Federal law mandates making tax filings private, state law cannot override this intent of the Federal law.
If the state law imposes any penalties on a Federal public official for non-compliance, it would also be afoul of the Supremacy Clause because the Supremacy Clause
prohibits states from interfering with the federal government's exercise of its constitutional powers
(the quoted part is also from the same link).
If there are exceptions to be made to this Federal law, they cannot be made on a state level. This isn't about state taxation. States can continue to impose taxes. This is about privacy of tax information. As long as any Federal tax information makes its way into state filings (it usually does and, in case of NY State, investment information definitely does), states cannot break the Federal government's assurances of privacy of such information without interfering with Fed Govt's exercise of its powers.
If the Federal legislative body wants the power to view a public official's tax returns, then the Federal legislative body (i.e., Congress) is going to have to change the Federal law itself.
However, such a change cannot apply retroactively. Article I section 10 (of the US Constitution) prohibits states from passing any ex post facto laws. So any law passed by a state cannot punish past conduct or impose a burden on conduct which has already happened. Article I section 9 prohibits Congress from passing any ex post facto law. So even though such a law would have to be passed by the Federal government, such a law can only regulate future conduct.