We investigate the two-dimensional excitation structure of the interstellar medium (ISM) in a sample of luminous infrared galaxies (LIRGs) and Seyferts using near-IR integral field spectroscopy. This study extends to the near infrared the well-known optical and mid-IR emission line diagnostics used to classify activity in galaxies. Based on the spatially resolved spectroscopy of prototypes, we identify in the [FeII]1.64 µm/Brγ − H 2 2.12 µm/Brγ plane regions dominated by the different heating sources, i.e. active galactic nuclei (AGNs), young main-sequence massive stars, and evolved stars i.e. supernovae. The ISM in LIRGs occupy a wide region in the near-IR diagnostic plane from −0.6 to +1.5 and from −1.2 to +0.8 (in log units) for the [FeII]/Brγ and H 2 /Brγ line ratios, respectively. The corresponding median(mode) ratios are +0.18(0.16) and +0.02(−0.04). Seyferts show on average larger values by factors ∼2.5 and ∼1.4 for the [FeII]/Brγ and H 2 /Brγ ratios, respectively. New areas and relations in the near-IR diagnostic plane are defined for the compact, high surface brightness regions dominated by AGN, young ionizing stars, and supernovae explosions, respectively. In addition to these high surface brightness regions, the diffuse regions affected by the AGN radiation field cover an area similar to that of Seyferts, but with high values in [FeII]/Brγ that are not as extreme. The extended, non-AGN diffuse regions cover a wide area in the near-IR diagnostic diagram that overlaps that of individual excitation mechanisms (i.e. AGN, young stars, and supernovae), but with its mode value to that of the young star-forming clumps. This indicates that the excitation conditions of the extended, diffuse ISM are likely due to a mixture of the different ionization sources, weighted by their spatial distribution and relative flux contribution. The integrated line ratios in LIRGs show higher excitation conditions i.e. towards AGNs, than those measured by the spatially resolved spectroscopy. If this behaviour is representative, it would have clear consequences when classifying high-z, star-forming galaxies based on their near-infrared integrated spectra.