Real moved into second place on 78 points, two behind leaders Atletico Madrid with two games left to play.
Should Real fail to beat Bilbao, Atletico will be champions if they overcome Osasuna.
"It's not just about scoring goals. We played well in defence, too," Real coach Zinedine Zidane said.
"It was a really complete game. We didn't get overrun at 2-1 and scored quickly after and that shows what character this side have.
"It was a great win against a tough opponent at a difficult place to come to. We are going to give our all in the two remaining games, until La Liga is finished."