The Catalans fell behind in the eighth minute when centre back Oscar Mingueza headed the ball towards his own goal and although keeper Marc-Andre ter Stegen got a hand to the ball, Cadiz forward Alvaro Gimenez helped it over the line.
Barca drew level with a fortuitous goal of their own in the 57th when Cadiz defender Pedro Alcala diverted a Jordi Alba cross into the net, flummoxing his impressive goalkeeper Jeremias Ledesma who had been keeping Barca at bay.
Cadiz restored their lead six minutes later, however, when Alvaro Negredo capitalised on a calamitous mix-up between Barca defenders Alba and Clement Lenglet following a throw-in.
Alba aimed the throw towards Lenglet but the Frenchman could not control the ball and Negredo, on the pitch for less than a minute, ran to press Ter Stegen, blocked his kick out and dribbled the ball past into the unguarded net.