Abstract The control of hybrid quantum systems via the application of external fields is rapidly evolving field of research for the development of quantum applications and technologies. We model and optimize the dynamics of a hybrid quantum system consists of two non-local ensembles of nitrogen-vacancy centers and a superconducting transmon qubit mediated by two transmission line resonators. We apply a set of optimized time-dependent external driving field to enhance the system performance to function as a high fidelity state-to-state transfer. The Hamiltonian of the externally driven transmission line resonators is modelled by considering the non-linear transmons. The numerical simulation of the system is done using the optimized parameters of the external fields. By applying the optimized pulses, we have increased the fidelity of the state transfer from 0.7 to 1.0 within 100 ns. By varying the full wave half maxima value (FWHM) of the Gaussian pulse, it result in decreasing the amplitude of the fast oscillating states of the transmon and nitrogen-vacancy ensembles. These optimized external pulses also created a strong coupling between the components of under-consideration physical quantum system, which will eventually increase the fidelity of the system in a relatively faster time.