The Junior Teranga Lions dominated the early exchanges, forcing their hosts on the defensive, and were rewarded in the 14th minute when Ibrahima Seck opened the scoring after bending his effort in from a corner kick.
The Spanish youngsters found their rhythm thereafter and began to enjoy ball possession but the west Africans were able to keep them at bay until the break while preserving their one-goal lead.
The 4,000 enthusiastic local supporters soon cooled off after Sadio Mane of French Ligue 2 side Metz doubled the visitors' advantage moments into the second half when his powerful attempt from the centre of the park had Spanish goalkeeper David De Gea sprawling to no avail.
The Senegalese held their defensive line well until the end of the meeting, with the 2-0 scoreline unaltered.
The Junior Lions will play their last warm up friendly against Switzerland on Tuesday before heading for Manchester, where they will open their campaign against hosts Great Britain on July 26 at Old Trafford.