As others have said, you'll need to code a collision system by yourself if you need 3D collisions. However, for simple cases you could get away with a pretty easy hack: have 2D collisions like normal, but add in a check to compare Z and height values. If the objects just overlap in the 2D plane but doesn't overlap in Z as well, just abort without doing the actual collision stuff. To have a collision in 3D, you need to overlap both in X, Y, and Z.
And of course, for games like mazes and racing, you're usually stuck in the XY plane all the time anyway, so you don't need to code 3D collisions, you just use 2D collisions but add 3D graphics.
(I've made an asset for this kind of stuff, btw:
https://yaru.itch.io/yarufps ... it's not super flashy or anything, but it exists)