|“||I shall help. I will open the way for a brief moment. A moment is all I can do.||”|
–Gremlin Haig, Epic Mickey
Use the posessed tables to get up to the painting, thin it out, and jump in. There's also the Lonesome Manor I Extra Content next to his cage. If you do not want to do all that work to do all that then you can just thin out the painting and use an Anvil. After Haig is free, he'll fix the pressure plate next to where his cage was. The gate leading out of the area will open for ten seconds and will do so every time Mickey steps on the plate. If Mickey fails to get out in time the gate will close and the mouse will have to use the tables to get up to the painting to step on the plate again.
If Mickey succeeds, he'll have failed Screechin' Sam's Quest. However, if Mickey completes the ghost's Quest, the tables return to the ground, so Mickey can't reach the plate or rescue Haig if he hasn't done that yet. There's only one way to get the Gremlin Guardian Pin and help the Lonesome Ghost at the same time: free Haig, let the ten seconds expire, then paint in the skulls.