You already have to be in the Governor's Mansion.
And you should have run the yak, rhinoceros, wax-lips automated gauntlet by passing through the double doors to the right of the front door.
Now, what did Guybrush say he needed to remove the Idol of Many Hands from its case?
He needs a file.
Who might have file?
To saw through bars with?
The prisoner in the jail might have one. Why don't you talk to him and ask him if he has a file?
He says no. All he has is a carrot cake his Aunt Tillie made him.
In bad movies, where is the file always hidden when it is smuggled to the prisoner?
The relatives always hide it in a loaf of bread, or a pastry, or...
In a carrot cake.
Once Otis has given you the carrot cake, open it to find a file inside.
Go back to the mansion, and climb through the hole behind the painting to get the Idol.