Build a better fleet than the two African states, and block the strait of Gibraltar. They won't be able to cross over when you're fleet is in the strait, and any sea-crossings they attempt via fleet, you can take out with your stronger fleet. You should be able to check the ledger for fleet strengths.
Declare war on Grenada, take them out while keeping the Africans out via the above method while you occupy and annex Grenada.
After that, you can deal with the two African states, or just wait for them to accept a white peace. They will eventually, or should.
Things to watch out for: Coalitions (AFAIK you won't be able to peace-out and annex Grenada if they're a minor-member of a coalition that is at war with you), and both you and Grenada being minor members in a non-coalition war. You need to either negotiate with the war-leader if you're a minor war member, or you need to be the war-leader on your side to negotiate with minor war-members on the opposing side.
Things to hope for: Algiers and Morroco being minor members in the war and Grenada is the war-leader, or better yet, neither of them answer the call to arms. Either way, you'll be able to annex Grenada and finish the war without a lingering fight with the two African nations.