Distributed sensing of gas-phase chemicals is a promising application for mesoporous materials when combined with highly sensitive miniaturized gas sensors. We present a direct application of a mesoporous silica thin film on a highly sensitive miniaturized resonant chemical sensor with a mass sensitivity at the zeptogram scale for relative humidity and CO2 detection. Using mesoporous silica thin-film, we report one of the lowest volume resolutions and a sensitive detection of 5.1 x 10(-4)% RH/Hz to water vapor in N-2, which is 70 times higher than a device with a nontemplated silica layer. In addition, a mesoporous thin-film that is functionalized with an amino-group is directly applied on the resonant sensor, which exhibits a volume sensitivity of 1.6 x 10(-4)%/Hz and a volume resolution of 1.82 x 10(-4)% to CO2 in N-2.