Just have the Jagiellons be more pro-Habsburg. Have them a bit more lucky, with perhaps Sigismund the Old having two surviving sons. The second marries into the Habsburgs through a Spanish Infanta. A pious Catholic, he and his wife choose to depart Poland for Spain due to Sigismund II Augustus's religious policies, which disgust them. Happy to live in a country "free of heretics" this Jagiellon line domiciles in Spain, and Philip II grants them the title of Infante. The Spanish Habsburgs go extinct and this Jagiellon branch, fully Catholic and an extended part of the Habsburg family through blood, take the throne.
Kinda unrealistic, but not... totally impossible, like some ideas tossed around here. Does that help you?