It remains unclear which physical processes are responsible for the dramatic increase with height of the temperature in stellar atmospheres, known as the chromospheric ($\sim$10,000 K) and coronal (several million K) heating problems. Statistical studies of sun-like stars reveal that chromospheric and coronal emissions are correlated on a global scale, constraining, in principle, theoretical models of potential heating mechanisms. However, so far, spatially resolved observations of the Sun have surprisingly failed to show a similar correlation on small spatial scales, leaving models poorly constrained. Here we use unique coordinated high-resolution observations of the chromosphere (from the Interface Region Imaging Spectrograph or IRIS satellite) and the low corona (from the Hi-C 2.1 sounding rocket) and machine-learning based inversion techniques to show a strong correlation on spatial scales of a few hundred km between heating in the chromosphere and low corona for regions with strong magnetic field (``plage"). These results are compatible with recent advanced 3D radiative magnetohydrodynamic simulations in which the dissipation of current sheets formed due to the braiding of the magnetic field lines deep in the atmosphere is responsible for heating the plasma simultaneously to chromospheric and coronal temperatures. Our results provide deep insight into the nature of the heating mechanism in active solar regions.