I would caution you that cube captures are obscenely slow, like way slower than doing 6 regular 2D captures of equivalent resolution. This is one of the ways I tried to do it, and ultimately trashed it because it wasn’t worth the huge added cost just to have a slightly more convenient setup.
For what it’s worth, the way I set this up was to just do a ray-sphere intersection (with the camera at the sphere origin) to get the cubemap coordinate. You can adjust the FoV by offsetting the camera position. You won’t get a full 360º fisheye effect this way though, probably not much higher than 270º.