We present the gravity dual to a class of three-dimensional N = 2 supersymmetric gauge theories on a U(1) x U(1)-invariant squashed three-sphere, with a non-trivial background gauge field. This is described by a supersymmetric solution of four-dimensional N = 2 gauged supergravity with a non-trivial instanton for the graviphoton field. The particular gauge theory in turn determines the lift to a solution of eleven-dimensional supergravity. We compute the partition function for a class of Chern-Simons quiver gauge theories on both sides of the duality, in the large N limit, finding precise agreement for the functional dependence on the squashing parameter. This constitutes an exact check of the gauge/gravity correspondence in a non-conformally invariant setting. (C) 2012 Published by Elsevier B.V.