The development of sensing schemes for the detection of health-threatening gases is an attractive subject for research towards novel integrated autonomous sensor systems. We report here on a novel way of sensing NO2 by surface plasmon resonance (SPR) using a gas-sensitive layer composed of 5,10,15,20-Tetrakis(4-hydroxyphenyl)-21H,23H-porphine (2H-OHTPP) embedded in a nanoporous silica matrix on top of a gold thin film. The sensing mechanism is based on the modification of the SPR condition due to gas induced changes in the optical properties of the sensing layer. We demonstrate that the use of nanoporous silica as embedding matrix enhances the detection sensitivity compared to a polymer matrix with low porosity. The second important finding of this work is that the active layer thickness plays a significant role in the enhancement of the sensing response. The improvement is explained by the optimization of the overlap between the field of the surface plasmon polariton and the active dielectric layer.