Weak adsorption of gas reactants and strong binding of intermediates present a significant challenge for most transition metal oxides, particularly in the realm of CO2 photoreduction. Herein, we demonstrate that the adsorption can be fine-tuned by phase engineering of oxide catalysts. An oxygen vacancy mediated topological phase transition in Ni-Co oxide nanowires, supported on a hierarchical graphene aerogel (GA), is observed from a spinel phase to a rock-salt phase. Such in situ phase transition empowers the Ni-Co oxide catalyst with a strong internal electric field and the attainment of abundant oxygen vacancies. Among a series of catalysts, the in situ transformed spinel/rock-salt heterojunction supported on GA stands out for an exceptional photocatalytic CO2 reduction activity and selectivity, yielding an impressive CO production rate of 12.5 mmol g-1 h-1 and high selectivity of 96.5 %. This remarkable performance is a result of the robust interfacial coupling between two topological phases that optimizes the electronic structures through directional charge transfer across interfaces. The phase transition process induces more Co2+ in octahedral site, which can effectively enhance the Co-O covalency. This synergistic effect balances the surface activation of CO2 molecules and desorption of reaction intermediates, thereby lowering the energetic barrier of the rate-limiting step.