With this victory, Barcelona are on the verge of winning the 27th Spanish Football League title.
Barcelona took their total to 82 points in 33 games, taking the lead to 14 points with second-placed Real Madrid, who play fourth-placed Real Sociedad later on Tuesday.
Osasuna defender Jorge Herando was sent off for a foul on Pedri midway through the first half.
But Osasuna managed to hold on until the 85th minute when Robert Lewandowski sent a cross to Frenkie de Jong, who headed it towards Alba, then the latter shot it left-footed into the net.
Read the Latest World News Today on The Eastern Herald.