How to handle multiple cubemaps

I “project” the depth of a scene, made up by a terrain and a feature, onto a cubemap. I want to be able to store or project the results of stencil test onto another cubemap but I am uncertain how to do this. So far I have written the following code which is failing,

cube_tex = glGenTextures(1)
glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, cube_tex)

for i in range(6):
    glTexImage3D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+i, 0, GL_R32F, 2000, 2000, 12, 0, GL_RED, GL_FLOAT, None)
    glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, cube_tex, 0, i)
    glTexImage3D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+6+i, 0, GL_STENCIL_INDEX8, 2000, 2000, 12, 0, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, None)
    glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, cube_tex, 0, 6+i)

glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST) 
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE)

I believe that I need to use glTexImage3D once I am using a GL_TEXTURE_CUBE_MAP_ARRAY but I am uncertain about the rest.

Can anyone provide me some guidance or references (preferably with examples) that I could consult?
Thanks

So I do not think that I should use a cubemap_array as I am generating cubemaps that hold different type of information with different formats. Instead I just generated two different cubemaps. I use one cubemap to store the distance from the camera and the second cubemap the projection of some object I select.

Here is the code, in case it is useful to someone:

fbo = glGenFramebuffers(1)
glBindFramebuffer(GL_FRAMEBUFFER, fbo)

# create cube texture to store depth
# ----------------------------------

cube_depth_tex = glGenTextures(1)
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_depth_tex)

for i in range(6):
      glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+i, 0, GL_R32F, 2000, 2000, 0, GL_RED, GL_FLOAT, None)
      glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, cube_depth_tex, 0, i)

glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE)
glBindTexture(GL_TEXTURE_CUBE_MAP, 0)

# create cube texture for stencil
# ----------------------------------

cube_stencil_tex = glGenTextures(1)
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_stencil_tex)

for i in range(6):
      glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+i, 0, GL_STENCIL_INDEX8, 2000, 2000, 0, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, None)
      glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, cube_stencil_tex, 0, i)

glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE)
glBindTexture(GL_TEXTURE_CUBE_MAP, 0)

If you’re storing depth and stencil information, a single cube map using one of the depth+stencil formats (GL_DEPTH32F_STENCIL8 or GL_DEPTH24_STENCIL8) may be more appropriate. Particularly if you’re using built-in depth calculation and/or depth testing.

Sorry @GClements I missed your answer. Thanks. I want to use 32 bits for the depth buffer hence why I am using two different cubemaps.
Thanks again!