It was a memorable win for the visitors as Alaves earned an unlikely lead as a series of throw-ins finally led to a chance with Kiki Fermenia whipping in a cross which Deyverson converted.
Jeremy Mathieu then equalised from a corner swung in by Neymar to soothe the Nou Camp nerves.
But then, against the run of play, Alaves found themselves in front once more through Ibai Gomez and that goal proved to be the winner on a historic night for the Basque country team.
Elsewhere, Cristiano Ronaldo returned from injury to score in Real Madrid’s 5-2 victory over Osasuna at the Santiago Bernabeu.
It took Ronaldo just six minutes to open scoring for Zinedine Zidane’s side to help Los Blancos to their 15th consecutive La Liga win.
Danilo, Sergio Ramos, Pepe and Luka Modric all scored while Oriol Riera pulled one back for Osasuna and Kiko Casilla saved a Roberto Torres penalty, before David Garcia grabbed another and Cayetano Bonnin was sent off.
Ramos’ header means the Spain centreback has now scored in each of the last 13 La Liga seasons, equalling the all-time record of former Athletic Bilbao star Aitor Larrazabal.
Elsewhere, French striker Antoine Griezmann scored a brace to help Atletico Madrid to their first La Liga win of the season with a comfortable 4-0 victory over Celta Vigo.
Griezmann pulled the strings for Atleti, scoring twice and laying an assist for Koke in a sensational solo performance, one that his side needed after draws in their opening two matches against Leganes and Alaves.
The Frenchman headed in two goals in the 73rd and 81st minute before being substituted and Angel Correa rounded off a comprehensive second-half performance to add the fourth.
It means Griezmann has now scored two goals in his two league outings for Atletico.