Levante found Barcelona's weak spot in defending set pieces when Carles Puyol's clearance of a free kick fell for El Zhar to score at the second attempt after goalkeeper Jose Pinto had blocked his powerful first shot.
Barcelona was more inspired after the break and Messi's first pass to Tello led to the equalizer. Goalie Javier Jimenez got down to block Tello's shot, but Loukas Vyntra struck the loose ball off teammate Juanfran Garcia and into the net.
Messi again floated back to the center of the pitch to draw the defense with him before threading another pass to meet Tello's run, and this time the forward fired the ball beyond Jimenez to give Barcelona the lead.
The Argentina star fended off a tackle and slid a diagonal ball for Tello to score his second before Messi picked him out with a pass over the top for his third goal.
"Our first half worried me, but we have players that don't need 45 minutes to turn the match around," Barcelona coach Gerardo Martino said. "(Messi) can change this and any other game. He can undo any type of defense. The tiredness of our rivals played its part and the spaces opened up as they wore down. Leo took great advantage of them."
Puyol had to be replaced by Javier Mascherano in the 57th due to an apparent leg injury. The 35-year-old Puyol has been plagued by a series of injuries for the past two seasons.
Martino, however, said that Puyol's injury was "only a leg knock."
Sociedad forward Gonzalo "Chory" Castro crossed twice for Gonzalez to score his goals, the first coming in the third minute followed by another in the 34th -- just two minutes after Racing's Andreu Guerao had hit the crossbar.
Carlos Vela curled in Sociedad's third in the 62nd, but Mahamadou Kone gave Racing hope for next week's return leg by scoring in the 83rd.
Defending champion Atletico Madrid plays Athletic Bilbao on Thursday. Real Madrid won 1-0 at Espanyol on Tuesday.