Vacuum deposition of perovskite solar cells can achieve efficiencies rivaling solution-based methods and allows for more complex device stacks. MoO3 has been used to enhance carrier extraction to the transparent bottom electrode in a p-i-n configuration; here, we show that by inserting an molecular interlayer with a lone pair nitrogen atom and low ionization potential, it can also be used on the top of a perovskite absorber in a n-i-p configuration. This strategy enables the first vacuum-deposited perovskite solar cells with metal oxides as charge transporting layers for both electrons and holes, leading to power conversion efficiency >19%.