Andoni Iraloa pulled one back for the Spanish outfit but the Premier League side held out for the win.
It was the Spanish team who had the first chance of the match through Benat Etxebarria, but his shot from the edge of the box curled high and wide of the target.
Bilbao nearly took the lead in the 16th minute as Etxebarria's free kick found Markel Susaeta in the box, but he could only prod the ball wide.
Etxebarria again came close to putting the away team ahead just moments later when he chipped towards goal, but could only watch his effort come back off the crossbar.
Cardiff again managed to stay in the 22nd minute when some sloppy defending allowed Iker Muniain a chance on goal, but he shot wide of the post.
Toquero should have given Bilbao the lead in the 31st minute when he was unmarked in the area but skied his volley over after a cross from the right.
However, Cardiff took the lead against the run of play just before the break when Whittingham rifled home an effort from long range.
Cardiff doubled their lead shortly after half time when Campbell rounded Gorka Iraizoz before slotting the ball into the back of the net.
The two-goal cushion lasted only last five minutes, though, as Iraloa volleyed the ball home at the far post.
Cardiff nearly added a third eight minutes from time through Whittingham's deflected shot, but Iraizoz was equal to the effort.