The gimbals I use have an "encoder" that mounts on the gimbal and a larger board with a processor and ESC that mounts on the quad. I'm guessing that you want to use an ESC and CC3D in place of that larger board.
First of all, the CC3D does not know how to talk to a bare encoder. Second of all, normal flight motor ESCs don't have holding torque when the motor is stopped.
If you still wanted to use a CC3D, you would basically discard the encoder and mount the CC3D on the gimbal, then you would use an ESC specifically designed for this kind of motor (if you can even find one). Finally, on the CC3D, you would set a single channel in Attitude mode and adjust the PIDs. The bulky CC3D mounted on the gimbal and the expense of the special ESC and hassle ... I would greatly recommend that you just buy a compatible gimbal controller that has the equivalent of ESC and CC3D built in. It probably is just as cheap as buying the correct ESC. You can get one, with the encoder for about USD $10 shipped on eBay.
For comparison, you can buy a complete 2D brushless gimbal for about USD $32 shipped on eBay. It has inputs, so that you can tilt it (still stabilized, but now it is tilted too) by connecting an aux RC channel to it.
I only checked eBay, probably other places too.