Only if, under maritime law, Spain has been trying to recover its contents since it sunk.
Admiralty law, not maritime law. It belongs to the nation it sailed under in perpetuity, at least in theory. Notice by the way, they aren’t spending any time searching for some long lost monarch’s checkbook or bonds issued by a bankrupt entity, these treasures have an intrinsic value in of themselves, independent from governments or legal tender laws.
Warships are different from merchant vessels: they are considered sovereign property with a claim that never expires.