We report the topological transition by gate control in a Cd3As2 Dirac semimetal nanowire Josephson junction with diameter of about 64 nm. In the electron branch, the quantum confinement effectenforces the surface band into a series of gapped subbands and thus nontopological states. In the hole branch, however, because the hole mean free path is smaller than the nanowire perimeter, the quantum confinement effect is inoperative and the topological property maintained. The superconductivity is enhanced by gate tuning from electron to hole conduction, manifested by a larger critical supercurrent and a larger critical magnetic field, which is attributed to the topological transition from gapped surface subbands to a gapless surface band. The gate-controlled topological transition of superconductivity should be valuable for manipulation of Majorana zero modes, providing a platform for future compatible and scalable design of topological qubits.