Imo it's because the connection with Boa, he might've went there to help out.
Rayleigh lives in Sabaody directly above Fishman Island. Caribou knows Shirahoshi is Poseidon, and wanted to share that information with someone (Blackbeard).
If Rayleigh fought Blackbeard, I bet it was because Blackbeard attacked Fishman Island and stole Shirahoshi (or at least tried to).
Garp and Rayleigh vs the Blackbeard Pirates? Sounds like a fucking fantastic fight to offscreen. Can't wait to see Oda not draw it