The price for spell casting assumes you that you go to the caster and he casts it in the safety and comfort of his own dwelling. At best he may travel a short distance, probably no more than an hour. It does not include putting the spell caster in danger. That is going to multiply the cost by a lot.
The price also assumes that you go to the caster and they cast the spell. This leaves him free to charge other people for his other spells. If he is accompanying you, you probably need to purchase all of his spells every day even if they are not cast. By my estimate a 5th level wizard can make 1,000 gp per day by selling all his spells. This would mean to have a spell caster travel with you costs at least that much.
So assuming the caster is doubling the cost for hazardous duty that would be about 2,000 gp per day per caster. If you hire 5 of them, that works out to about 10,000 per day or 300,000 per month. So to hire 5 5th level caster per day on a pirate ship should be about 3,600,000 gp per year. That also does not include room and board, or the fact that the spell casters may decide they deserve a share of the treasure.
Would your adventurers make that much for traveling on a ship? If not, why not?