Barcelona full-back Alba scored at both the start and end of the clash in Fortaleza with substitute Fernando Torres netting in between to follow up his four-goal salvo in the 10-0 win over Tahiti.
The victory leaves Spain top of Group B with three wins from three and the reigning world and European champions will now face Group A runners-up Italy in the semi-finals, the side they beat 4-0 in the final of Euro 2012.
Nigeria had their chances but could not take advantage of them and they finish in third spot with three points.
Spain coach Vicente del Bosque drafted back in many of his first-choice line-up for the match after ringing the changes against Tahiti, and it took them just three minutes to open the scoring when Alba picked up a pass from Andres Iniesta, bundled his way through a couple of challenges and poked a shot past Vincent Enyeama.
Both sides had chances to add to the scoreline in an entertaining first half, with rival goalkeepers Enyeama and Victor Valdes being called into action while Spain striker Roberto Soldado struck the post from close range just before half-time.
Nigeria spurned a great chance to level at the start of the second half when Brown Ideye could not control a cross with an open goal at his mercy, and Spain made them pay soon after when Torres doubled their lead.
The Chelsea striker had only just replaced Soldado when he finished off a fine Spain move by powering a diving header past Enyeama from six yards out.
Nigeria missed another great opportunity to get back into the game with 15
minutes to go when replacement Mohammed Gambo sliced wide with only Valdes to beat.
Spain then wrapped up the scoring in the 88th minute when a ball over the top found Alba in acres of space inside the Nigeria half and he rounded Enyeama before slotting into an empty net.