Munir El Haddadi, deployed up front in place of the injured Neymar, fired Barca ahead in the second minute at the Rosaleda Stadium on the south coast after smart work from Luis Suarez.
However, the visitors were unable to exert their customary control and Malaga, whose relentless pressing unsettled the Spanish and European champions, netted a deserved equaliser in the 32nd minute.
Javier Mascherano surrendered possession in a dangerous area and the ball fell to midfielder Juanpi whose shot was deflected in off the former Liverpool player as he slid across to block.
Messi was back in the side after sitting out Wednesday’s 2-1 King’s Cup triumph at Athletic Bilbao as a precaution but the FIFA Ballon d’Or winner was largely anonymous in the first half.
Barca were much improved in the second period and took a 2-1 lead in the 51st minute when Messi cracked Adriano’s cross past keeper Carlos Kameni.
Visiting keeper Claudio Bravo then did well to palm away a shot from Ignacio Camacho in the 73rd minute and Kameni denied Messi a second with a superb one-handed save two minutes from time.
Barca are on 48 points, one ahead of Atletico before Diego Simeone’s side host seventh-placed Sevilla (32) on Sunday.
Real Madrid are four points adrift of Atletico in third place ahead of Sunday’s trip to Real Betis who are 15th on 21 points.
Qatar-owned Malaga are 12th on 24 points.