Barca triumph as Messi makes 500th Liga appearance
Messi returned for Barca after missing the final game of 2020 with an ankle knock and swung in a cross for Frenkie de Jong to divert home for the only goal on 27 minutes.
Although Ronald Koeman's side began a potentially season-defining run of four consecutive away matches with a comfortable win, they remain a distant 10 points behind Atletico in fifth having played a game more.
Barca dominated possession and created a number of chances but Huesca goalkeeper Alvaro Fernandez produced several fine saves to keep the hosts in touch.
After De Jong's opener Messi was denied a second just before half-time when Fernandez superbly clawed away his free-kick heading towards the top corner.
The Argentine was again thwarted by the legs of Fernandez in the second half after combining well with Pedri, moments after Marc-Andre ter Stegen reacted sharply to keep out Rafa Mir's inventive back-heel.
That was a rare threat from Huesca who have now won just once in 17 tries this season but had taken points off most visitors to their Estadio El Alcoraz so far, including Atletico in September.
Athletic Bilbao sacked coach Gaizka Garitano following a 1-0 home win over Elche, with Marcelino getting the job.
Real Sociedad lost more ground on the top two after they could only manage a 1-1 draw at home to struggling Osasuna, while teenager Bryan Gil scored both goals in Eibar's 2-0 defeat of Granada.