An earlier Spanish-American war is risky, through, since it would end up much better for Spain -even with a victory. Spain had been getting weaker every year, and the US stronger, but even then the actual war depended much on early luck than broke the SPanish resolution.
Spain had a truly awful 19th century, and retreated into itself on the hope than it would avoid the European wars and (hopefully) recover its strenght. It was a stupid policy, of course, since the first time it met a neighbour than wanted something Spain owned (this being the US and Cuba/Philipines), Spain lost everything.
But by 1898 Spain had been incredibly weakened by years of the Cuban revolution and political instability at the capital, while the US had recovered form the damage of the civil war. Get back even ten years (and the POD is 19) and Spain is stronger, while the US is weaker, and the american victory is no longer certain.
Note than this my be good for both Spain and the US on the long view. Spain wins the war, or loses the war, but it WILL be a very close match (no territories exchanges, merely monetary compensations), so it gets a great scare and start to take a more serious approach about its possesions -if Hispaniola turns into a state, Cuba and Puerto Rico may do the same for Spain, as a solution for the cuban revolution, and the same for the eteranlly fractious iberian provinces. In the early 20th century Spain could be a recovering nation, instead of the collapsing one than ended on the Spanish Civil War.
And the US has always been very forgiving to former enemies, and a increasingly democratic, and rich, Spanish Cuba, would be an important trade partner on the future, like Canada. Spain is triing to avoid european disasters, so a transatlantic (and trnascaribean) alliance may seem a good idea.