An Empirical Decomposition of Near-Infrared Emission into Galactic and Extragalactic Components