Andres Iniesta, Jordi Alba and Alvaro Morata also netted in a one-sided display from the 2010 world champions.
The only negative for Spain was the sight of local hero Isco being asked to be substituted after being hit with a tough tackle from Costa Rica defender Kendall Waston, who was immediately hauled off after being booked for the challenge.
The Real Madrid midfielder, who is from Malaga and spent two impressive seasons playing at La Rosaleda before moving to Madrid, was given a standing ovation as he left the pitch.
Silva, Isco and Iniesta combined to stunning effect throughout the game, with the Manchester City midfielder laying on the pass for his former Valencia teammate Alba to thrash past Costa Rica's stand-in goalkeeper Danny Carvajal in the sixth minute.
Carvajal was deputising for the injured Real Madrid goalkeeper Keylor Navas and had a torrid night.
He spilled a Silva shot into the path of Morata for Spain's second midway through the first half.
Spain next travel to World Cup hosts Russia on Tuesday.
Disclaimer: No Business Standard Journalist was involved in creation of this content
