Imagining a box created by the interior surfaces of the gears ...
A very loose fit can be achieved by spacing the center of each gear's shaft from the corner of the box by a distance equal to the Pitch Diameter of the gear.
A better fit can be achieved by spacing one gear (as described above), while aligning the Tooth Root of the 2nd gear with the same edge. If using the "Gear Template Generator", this can be achieved through the following equation: (Pitch Diameter) = 2*[ (Distance from center of gear shaft to edge of box) + (Tooth Spacing)*(1.25)