Compelled speech, which seems to violate the First Amendment, can be constitutional if it is necessary to advance a compelling government interest. Under "strict scrutiny", a constitutional right can be restricted if it is necessary for a compelling government interest, is the least restrictive means of achieving that interest, and is narrowly tailored to accomplishing just that interest. However (see NIFLA v. Becerra, 595 US ____)
“The Court has afforded less protection for professional speech in two
circumstances—some laws that require professionals to disclose
factual, noncontroversial information in their ‘commercial speech’...”
The New York law seems to fall within that exception where the rules are not as strict. The law does not require a statement that the work might have been stolen by Nazi Germany, it say that
identifiable works of art known to have been created before nineteen
hundred forty-five and which changed hands due to theft, seizure,
confiscation, forced sale or other involuntary means in Europe during
the Nazi era (nineteen hundred thirty-three--nineteen hundred
must be identified as such. It would be a controversial claim to say that the work was specifically seized by Nazi Germany. Insofar as the law offers two expressions for identifying the time period, a museum can simply refer to the time period without explicitly mentioning Nazis or Germany.
It is not self-evident what state interest is being advanced – one can conjecture, but we would have to wait for a legal challenge to see what the state's claimed interest is. It seems to relate to education (since this is part of the education law), and education is a well-recognized compelling state interest.