im not sure the correct way.. but i have few ways to do that:
1: on the 3D environment: u can align the camera in such way so it will display only the objects in front of it.,. there for you can use 3d panels with 2d textures to display 2d.. and use 3d objects with different depths (play with Z axes)
Unity3D applies same basics since it has no 2D game engine
2) on the 2D environment: you can create 3d object with camera on it. so it will convert the 3d object into image..
both ways seems legit to me but i never used neither of them..
godot is such an easy engine to experiment by ur self :)
good luck