Capcom licensed Dynamix's Sid & Al's Incredible Toons engine with a Ghosts 'n Goblins motif, so it is essentially a sequel to that game.
The licensing agreement between Capcom and Dynamix allowed for the creation of a new game that built upon the foundation of the original Sid & Al's Incredible Toons, but with a distinct Ghosts 'n Goblins flavor.