As for Costa Rica, Real Madrid goalkeeper Keylor Navas was not involved due to an abductor problem, but there were starts for Celtic's Cristian Gamboa and Sunderland's Bryan Oviedo. Meanwhile, Espanyol's Oscar Duarte and Deportivo La Coruna's Celso Borges were also in the XI.
It was Spain that had the first half-chance of the match inside the opening four minutes, but Alba fired over the crossbar after the ball had fallen kindly for the left-back in a central position.
Alba made no mistake in the sixth minute, however, as the Barcelona defender converted a low Silva cross to send the home side ahead after a bright start in Malaga.
Morata might have doubled Spain's lead in the 13th minute after creating some space with an excellent piece of skill, but the Chelsea forward could not find a route past Costa Rica goalkeeper Danny Carvajal.
Morata did find the back of the net in the 23rd minute, however, after Carvajal failed to deal with a low cross from Silva, who along with Isco was running the show for La Roja.
Costa Rica's best chance of the first period came just before the 30-minute mark when Gamboa's effort angled towards the head of Johan Venegas, but the number 11 somehow failed to make contact in a central area.
Spain might have had three or four more in the latter stages of the first period as Pique threatened on two separate occasions, before Carvajal made a couple of excellent saves - keeping out a free kick from Isco and a close-range Morata attempt as the score stayed 2-0 entering the half-time break.
Saul Niguez, Nacho, Marc Bartra and Iago Aspas all came off the Spain bench at the interval, but the pattern of the match did not change, and the hosts scored their third in the 51st minute when Silva converted from close range following a mix-up in the Costa Rican defence.
Silva might have doubled his tally three minutes later when Aspas found the Manchester City attacker inside the Costa Rica box, but his effort was wide of the near post.
Silva had his second in the 55th minute, however, when he regained possession on the right before cutting inside and squeezing a shot through the gloves of the Costa Rican goalkeeper.
Marco Asensio replaced the sensational Isco in Spain's fifth change of the night in the 65th minute, and the hosts had their fifth goal in the 73rd minute when Iniesta's long-range effort found a route into the bottom corner.
Borges came close to grabbing a late consolation for Costa Rica after striking one towards the bottom corner, but Kepa was on hand to make a fine save as the reported Real Madrid target kept his clean sheet intact.