Density functional theory calculations were performed to investigate the interactions of NH3 molecules with TiO2/MoS2 nanocomposites in order to completely exploit the adsorption properties of these nanocomposites. Given the need to further comprehend the behavior of the NH3 molecules oriented between the TiO2 nanoparticle and MoS2 monolayer, we have geometrically optimized the complex systems consisting of the NH3 molecule positioned at appropriate sites between the nanoparticle and MoS2 monolayer. The structural properties such as bond lengths, bond angles, adsorption energies and Mulliken population analysis and the electronic properties including the density of states and molecular orbitals were also analyzed in detail. The results indicate that the interactions between NH3 molecules and N-doped TiO2 in TiO2-N/MoS2 nanocomposites are stronger than those between gas molecules and undoped TiO2 in TiO2/MoS2 nanocomposites, which reveals that the N doping helps to strengthen the interaction of NH3 molecules with hybrid TiO2/MoS2 nanocomposites. Therefore, the obtained results also present a theoretical basis for the potential application of TiO2/MoS2 nanocomposite as an efficient gas sensor for NH3 molecule in the environment.