Cani later laid the ball off for Marcos to score the second with a low shot five minutes from time.
Ronaldinho finally beat Viera with a free kick at the end only for the ball to hit the crossbar.
Sevilla defeated Athletic Bilbao 4-1 at home to retake second spot from Real Madrid and keep the pressure on Barca.
Brazilian striker Luis Fabiano missed an early penalty for Sevilla but was instrumental in turning the game in the second half of Sunday's match.
Fabiano set up Alexander Kerzhakov for the opener and the third for Ernesto Chevanton, either side of an Antonio Puerta goal.
The striker was rewarded with the fourth near the end after Fran Yeste had pulled one back for Bilbao.
The King's Cup and Uefa Cup semi-finalists moved a point ahead of Real Madrid on to 58.
|Luis Fabiano wants the title this much [AFP]|
Real beat fellow title-challengers Valencia 2-1 at the Bernabeu on Saturday.
Real Zaragoza took fourth place after Ewerthom scored twice in four minutes to earn a 2-0 victory at home against Celta Vigo.
The Brazilian forward came on as a substitute and struck two outstanding individual efforts midway through the second half to move Zaragoza on to 53 points, above Valencia on goal difference.
Recreativo Huelva beat Racing Santander, one of their rivals for a Uefa Cup place, 4-2 at home to go seventh on 49 points, one short of Atletico Madrid who lost 2-0 away to Real Sociedad on Saturday.
A stormy match in Barcelona saw four players sent off as Espanyol snatched an injury-time equaliser from a disputed penalty to draw 2-2 against Real Betis.
Espanyol had striker Walter Pandiani dismissed just before the break, while Betis had their goalkeeper sent off in the penalty incident.
Two more Betis players were dismissed for protesting the decision.
Levante drew 1-1 with Getafe at home.
Levante striker Riga bundled the ball in from close range as Getafe failed to clear a corner in the fourth minute.
In a similar move at the other end defender David Belenguer equalised when Levante keeper Jose Molina failed to collect a corner in the 57th.
Relegation-threatened Levante had Pablo Cavallero sent off from the bench at the end of their ninth game without a win.
Mallorca made it six wins in a row at home with striker Victor finishing off a well-worked counter-attack, racing through on to Juan Arango's backheel in the 21st minute.