Real Madrid ended the season second in La Liga despite a late 2-1 win over Villarreal at home on Saturday.
Real's victory was not enough to win the league as Atletico Madrid beat Valladolid 2-1 to claim their first title since 2014. Real finished the campaign on 84 points, two behind the champions.
Zinedine Zidane's side were uncharacteristically nervy from the off and were made to pay after 20 minutes as Pino latched onto Gerard Moreno's through ball before calmly finishing.
Luka Modric and Casemiro missed good chances for the hosts as the first half drew to a close.
Ten minutes after the restart Karim Benzema thought he had equalised, but his header was ruled out for offisde following a lengthy VAR review.
The Frenchman finally scored three minutes from time with a neat finish before teeing up Luka Modric for an injury time winner to turn the game on its head.
Villarreal end the season seventh, giving them a place in next year's inaugural Europa Conference League.