1800s are pretty different from today.
Cuba never had a self sufficient military. Most of their heavy equipment came from the soviets and hasn't been refreshed.
The island is within helicopter range of multiple US airbases. There's a well positioned military base already in place on the island.
Holding a jungle with unwilling people fighting you is never going to be easy, but there's a lot of differences between what Spain was against and what the US would be against.
The biggest issue would be that Cuba could plausibly actually land an attack on the US. It would be basically a coin toss on if that made people furious at Cuba or the administration.

