We investigate a quantum phase transition between a Neel phase and a valence bond solid (VBS) phase, in each of which a different Z2 symmetry is broken, in a spin-1/2 two-leg XXZ ladder with a four-spin interaction. The model can be viewed as a one-dimensional variant of the celebrated J-Q model on a square lattice. By means of variational uniform matrix product state calculations and an effective field theory, we determine the phase diagram of the model, and present evidences that the Neel-VBS transition is continuous and belongs to the Gaussian universality class with the central charge c=1. In particular, the critical exponents $beta, eta,$ and, $ u$ are found to satisfy the constraints expected for a Gaussian transition within numerical accuracy. These exponents do not detectably change along the phase boundary while they are in general allowed to do so for the Gaussian class.