The spectral properties of a one-dimensional photonic crystal bounded with a resonance-absorbing nanocomposite layer are investigated. The bulk concentrations of metal nanoparticles dispersed in a transparent nanocomposite matrix are determined at which the effective permittivity takes near-zero values. The transmission, reflection and absorption spectra of the investigated structures at the normal incidence of light are calculated. The demonstrated possibility of formation of the optical Tamm states at the interface between the photonic crystal and nanocomposite is ensured by the near-zero real and imaginary parts of the permittivity or only the imaginary part of the permittivity at the zero real part. The specific features of field localization at the optical Tamm state frequencies are examined.