Xavi's brave strike in the 80th minute levelled the scores at 2-2 and Lionel Messi cut in from the right flank to bury a shot in the far corner four minutes later.
Barca move on to 47 points from 18 games extending their lead over second place, which is now occupied by improving champions Real Madrid, who beat Real Mallorca 3-0 away.
Sevilla also have 35 points but are third on goal difference after their 3-1 comeback win at Deportivo Coruna on Saturday.
Messi set up Samuel Eto'o for his 16th goal of the campaign just before the break in a frozen Pamplona, but Osasuna bit back in the second half.
Miguel Flano looped in a header from a corner and Walter Pandiani slotted home from close range forcing Barca on to the back foot, before Xavi and Messi struck late on.
"We were lucky at the end but I think we deserved it," Xavi told Canal Plus television.
Real were quickly ahead in Mallorca when in-form winger Arjen Robben raced away on a counter-attack to score after only three minutes. Gonzalo Higuain set up captain Raul to score with a deft back heel in his 500th league game soon after.
Mallorca, who are without a league win in ten, offered scant resistance and Sergio sealed their third consecutive win with a volley.
Real coach Juande Ramos said the quick first goal had made it easier for his side, but denied they were too dependent on Robben's pace. The Dutchman has been their key figure in the last three games.
"A team doesn't rely on one player. It's his job to attack and he is given the freedom to do so by the work of other players," he said.
Valencia slipped down to fourth with 34 points after being held to a 3-3 draw at home by local rivals Villarreal on Saturday.
Atletico Madrid fell to pieces at home to Athletic Bilbao letting slip a 1-0 lead to lose 3-2.
They had Maniche sent off midway through the second half and a last minute goal from Diego Forlan did not prevent home coach Javier Aguirre having to leave the pitch with the crowd chanting for him to go.
"Three defeats in a week has put everyone on edge and put doubts in their minds. It's understandable that the fans are angry but we must remain calm," Aguirre said. Atletico are fifth with 30 points, ahead of Villarreal and Deportivo on goal difference.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1
Get FourFourTwo Newsletter
The best features, fun and footballing quizzes, straight to your inbox every week.