I suspect strongly that for this to happen, Spain would have had to give up Cuba, forcibly or otherwise, in the 19th century or even earlier.
Perhaps the 1810-1812 filibuster campaign might have been more strenuous, including crossing the straits to strike at what may have been perceived as the heart of Spanish power in the Caribbean--although that seems to be something of a stretch.
The Ostend Manifesto seems to me to be too late. By the 1850s, the sentiment for independence in Cuba would probably have been sufficient to make acquisition challenging--and by extension, adding Cuba as a commonwealth similar to Puerto Rico after 1898 would have been nearly impossible.
So: how could this be done, if at all?