It seems to me that you have several options here:
Just wait and see. After a while, your cat may climb out of the pit on its own. If you don't happen to have a treat in your inventory, make sure to stand more than three squares (orthogonal) / two squares (diagonal) away from the pits, so that your cat will want to move closer to you.
Go away for a while. Just exit Sokoban and spend some time exploring the main dungeon. If you're lucky, you might find a magic whistle or some other way to get your cat safely out of the pits. If not, eventually the cat will go feral, at which point you can safely kill it without repercussions (or, if you did find a magic whistle, retame it with food).
Just kill it. Killing your pet while it's still tame will cost you −15 alignment and −1 luck. The alignment penalty is pretty meaningless, since you can make it up by killing a few hostile monsters, but the luck penalty can hurt. However, if you're going to spend the next 600 turns pushing boulders around in Sokoban anyway, that'll be enough for the bad luck to time out.
Help it. You can help creatures out of pits by standing next to the pit and trying to #untrap
it.
The problem is that this only works reliably if there's a safe open square next to the pit for the creature to move into; if you try this in the middle of the Sokoban corridor, your cat will probably just fall immediately back into the pit, because you're blocking the only safe square it could move into.
I just tested this in wizmode, though, and (despite what the wiki still recently claimed) you don't seem to get punished for killing your pet like that (because it only falls back into the pit when it tries to move on its own turn). So, even if you may not be able to save your pet this way, this at least seems to be a safe way to get it out of the way.
Go in after it. If your cat is still in the pit closest to you (or if you can fill all the pits between yourself and the cat), you can just jump into the pit after it, displacing it to the square you were previously standing in. Your cat will complain about you so rudely shoving it out of its cozy pit, and its tameness may decrease slightly, but that's generally pretty harmless.
The risk with this approach is that you really don't want to displace your pet into a pit (or any other trap that might kill it), as doing so can anger your god. This includes both displacing your cat from one pit into another, as well as accidentally displacing it back into the pit when you climb out of it.
Also note that all of this if only an issue on the lowest Sokoban level. On the upper levels, creatures falling into the holes will simply end up back on the level below.
Also, a few tips on general strategy for Sokoban and pets. I personally like to take my pets with me into Soko; the trick is to keep a treat in your inventory so that they'll follow you closely, and to make sure you know where your pets are before pushing a boulder somewhere that could trap them behind it. Telepathy isn't strictly necessary, but it does come handy.
Many other people, though, prefer to just leave their pets behind in the main dungeon while they do Sokoban. It's very likely that they'll go feral while you do so, but as long as you have suitable food items with you (and that shouldn't be a problem; Soko is full of food), you can just retame any feral domestic pets once you've completed Sokoban.