In this note the AKSZ construction is applied to the BFV description of the reduced phase space of the Einstein-Hilbert and of the Palatini--Cartan theories in every space-time dimension greater than two. In the former case one obtains a BV theory for the first-order formulation of Einstein--Hilbert theory, in the latter a BV theory for Palatini--Cartan theory with a partial implementation of the torsion-free condition already on the space of fields. All theories described here are BV versions of the same classical system on cylinders. The AKSZ implementations we present have the advantage of yielding a compatible BV-BFV description, which is the required starting point for a quantization in presence of a boundary.