We assess the ability of neural network emulators of physical parametrization schemes in numerical weather prediction models to aid in the construction of linearised models required by 4D-Var data assimilation. Neural networks can be differentiated trivially, and so if a physical parametrization scheme can be accurately emulated by a neural network then its tangent-linear and adjoint versions can be obtained with minimal effort, compared with the standard paradigms of manual or automatic differentiation of the model code. Here we demonstrate this idea by emulating the non-orographic gravity wave drag parametrization scheme in an atmospheric model with a neural network, and deriving its tangent-linear and adjoint models. We demonstrate that these neural network-derived tangent-linear and adjoint models not only pass the standard consistency tests but also can be used successfully to do 4D-Var data assimilation. This technique holds the promise of significantly easing maintenance of tangent-linear and adjoint codes in weather forecasting centres, if accurate neural network emulators can be constructed.