Increasing interest in three-dimensional nanostructures adds impetus to electron microscopy techniques capable of imaging at or below the nanoscale in three dimensions. We present a reconstruction algorithm that takes as input a focal series of four-dimensional scanning transmission electron microscopy (4D-STEM) data and transcends the prevalent structure retrieval algorithm assumption of a very thin specimen homogenous along the optic axis. We demonstrate this approach by reconstructing the different layers of a lead iridate (Pb$_2$Ir$_2$O$_7$) and yttrium-stabilized zirconia (Y$_{0.095}$Zr$_{0.905}$O$_2$) heterostructure from data acquired with the specimen in a single plan-view orientation, with the epitaxial layers stacked along the beam direction.