We study nonlocal electrostatics in inhomogeneous dielectric environments on the sub-nanometer scale using a recently introduced polarization energy functional. This functional is able to generate a wavevector-dependent dielectric function ϵ(q) that reflects local correlations in the medium's polarization. Its longitudinal component either decays continuously from its macroscopic continuum value to one at large q, or additionally exhibits two poles with a negative band at intermediate wavevectors (overscreening), which is characteristic of polar fluids such as water. We show that the functional reproduces known nonlocal electrostatic effects: the pair potential between point charges or Born ions in water at distances less than 5 Å is strongly modified, and the Born solvation energy is found to either decrease or increase relative to its local electrostatics value, depending on which approximation is chosen for ϵ(q). We then apply the functional to geometries that can no longer be treated analytically, such as a molecular pore of finite length. In such an anisotropic dielectric background transverse correlations in the polarization field no longer vanish and can contribute to substantial modifications of the dielectric barrier for ion translocation in the regime of intermediate pore diameters of 6-10 Å.