The key to produce inorganic heterogeneous nanostructures, and to integrate multiple functionalities, is to enhance or at least retain the functionalities of different components of materials. However, this ideal scenario is often deteriorated at the interface of the heterogeneous nanostructures due to lattice mismatches, resulting in downgraded performance in most hybrid nanomaterials. Here, we report that there is a narrow window in controlling temperature in a Lewis acid-base reaction process to facilitate epitaxial alignment during the synthesis of hybrid nanomaterials. We demonstrate a perfectly fused NaYF4:Yb,Tm@ZnO heterogeneous nanostructure, in which the semiconductor ZnO shell can be epitaxially grown onto lanthanide-doped upconversion nanoparticles. By achieving a matched crystal lattice, the interface defects and crystalline grain boundaries are minimized to enable more efficient energy transfer from the upconversion nanoparticles to the semiconductor, resulting in both enhanced upconversion luminescence intensity and superior photoelectrochemical properties. This strategy provides an outstanding approach to endow lanthanide-doped upconversion nanoparticles with versatile properties.