The Hartman effect refers to the rather paradoxical result that the time spent by a quantum mechanical particle or a photon to tunnel through an opaque potential barrier becomes independent of barrier width for long barriers. Such an effect, which has been observed in different physical settings, raised a lively debate and some controversies, owing to the correct definition and interpretation of tunneling times and the apparent superluminal transmission. A rather open question is whether (and under which conditions) the Hartman effect persists for inelastic scattering, that is, when the potential becomes non-Hermitian and the scattering matrix is not unitary. Here, tunneling through a heterojunction barrier in the tight-binding picture is considered, where the barrier consists of a generally non-Hermitian finite-sized lattice attached to two semi-infinite nearest-neighbor Hermitian lattice leads. A simple and general condition is derived for the persistence of the Hartman effect in non-Hermitian barriers, showing that it can be found rather generally when non-Hermiticity arises from nonreciprocal couplings, that is, when the barrier displays the non-Hermitian skin effect, without any special symmetry in the system.