Most previous studies on nanofluidic motions were focused on liquid-solid interactions, with the important role of gas phase being ignored. Through a molecular dynamics simulation, we show that the gas-liquid interaction can be an indispensable factor in nanoenvironments. Gas molecules in relatively large nanochannels can be dissolved in the liquid during pressure-induced infiltration, leading to the phenomenon of "nonoutflow". By contrast, gas molecules tend to form clusters in relatively small nanochannels, which triggers liquid defiltration at a reduced pressure. The results qualitatively fit with the observations in a high-pressure-resting experiment on nanoporous silica gels.