I kept trying to stop it up until about day 19, then I just canceled all operations and stopped doing anything. At day 23 half of the infected states were cured and all the panic went away...
To beat the invisible goblin on CoT5 use ranged units like mermaid and centaur to push it back while succubi and witches attack the base. The Invincibility spell is useful too.