In the study of thermal entanglement of the Heisenberg spin chain model, one usually considers only the spin interaction between the nearest neighboring qubits. Actually, a generalized Heisenberg model, so-called J1-J2 Heisenberg model, which is constructed by considering the fact that not only the nearest neighboring but also the next nearest neighboring spin interaction also plays an important role. In J1-J2 Heisenberg model, due to the next nearest neighboring spin interaction, the frustration effect can occur and has an important influence on the magnetic properties of the model. In this paper we investigate the thermal entanglement of a five-qubit XXZ Heisenberg spin chain with the next nearest neighboring interaction in a magnetic field. Using the numerical method, we calculate the pairwise concurrences of the nearest neighbouring qubits and the next nearest neighboring qubits, abbreviated as C12 and C13 respectively. The numerical results show that the frustration parameter α has an important effect on the pairwise thermal entanglement. Moreover, C12 and C13 have different variations with the change of the frustration parameter α. Meanwhile, it is found that the temperature, magnetic field, Dzyaloshinkii-Moriya (DM) interaction and anisotropic parameter also have great effects on the thermal entanglement. The increasing of temperature can reduce the thermal entanglement. The magnetic field can enhance the thermal entanglement between both two nearest and next nearest neighboring qubits, but when the magnetic field becomes strong enough, only the thermal entanglement between the two nearest neighboring qubits is suppressed. A certain extent of DM interaction can enhance the thermal entanglement between the two nearest neighboring qubits. But for the next nearest neighboring qubits, without the magnetic field, the increasing of DM interaction mainly enlarge the entanglement vanishing area of frustration parameter α. When the system changes from anisotropic to isotropic state, the entanglement vanishing area also changes obviously for C12 and C13. Thus, we can choose appropriate magnetic field strength, temperature, frustration parameter, DM interaction parameter and anisotropic parameter to effectively control and enhance the thermal entanglement of the system.