Modifying the surface energetics, particularly the work function, of advanced materials is of critical importance for a wide range of surface- and interface-based devices. In this work, using in situ photoelectron spectroscopy, we investigated the evolution of electronic structure at the SrTiO3 surface during the growth of ultrathin MoO3 layers. Thanks to the large work function difference between SrTiO3 and MoO3, the energy band alignment on the SrTiO3 surface is significantly modified. The charge transfer and dipole formation at the SrTiO3/MoO3 interface leads to a large modulation of work function and an apparent doping in SrTiO3. The measured evolution of electronic structure and upward band bending suggest that the growth of ultrathin MoO3 layers is a powerful tool to modulate the surface energetics of SrTiO3, and this surface-engineering approach could be generalized to other functional oxides.