Wednesday and Sevilla played a similar gameplan to the Italians, denying the hosts space and breaking to take the lead just before halftime.
David Villa and World Player of the Year Messi completed the second-half comeback to leave Barca top with 68 points from 25 games, 15 ahead of second-placed Atletico Madrid, who host Espanyol on Sunday.
Real Madrid are third with 52 points after also having to come from behind to beat bottom side Deportivo La Coruna 2-1 with late goals from Kaka and Gonzalo Higuain.
Both Real and Barca, who meet in a Cup semi-final second leg at the Nou Camp on Tuesday, with the tie level at 1-1, struggled as they fielded weakened sides to rest key players.
"We knew we hadn't played a good first half and needed more," Barca's Argentine defender Javier Mascherano told Spanish television.
"In the second half, we played with a greater intensity and luckily we got a quick equaliser.
"We have a game that is like a final on Tuesday and we have a slight advantage. They are a great rival and we still have to finish the job."
Sevilla, who need to overturn a 2-1 deficit in their semi-final at home to Atletico on Wednesday, had also rested players but struck against the run of play when Alberto Botia rose above Dani Alves to nod past Victor Valdes in the 42nd minute.
Barca improved in the second period and Alves crossed for Villa to head the equaliser in the 52nd.
A slick passing move led to Cristian Tello feeding Messi in the area and the Argentine slotted away his 38th league goal of the season on the hour.
Sevilla had chances to equalise as Barca wobbled near the end with substitute Alvaro Negredo blazing a good chance over the bar late on.
Ronaldo on bench
At the Riazor, a determined Depor troubled a Real side who had left Cristiano Ronaldo on the bench.
Depor, who had lost five consecutive matches coming into the match, were dangerous on the break and from one such move striker Riki beat Diego Lopez at his near post with a powerful low drive in the 34th minute.
Real were reeling as Marcelo headed a Pizzi effort off the line, Riki swept a shot past the post and Lopez denied Bruno Gama with a flying save.
After coach Jose Mourinho brought on Ronaldo, Mesut Ozil and Sami Khedira in the 57th minute, Real upped their game and Brazil's Kaka swept in the equaliser with a curling shot from outside the area in the 73rd minute.
Kaka also featured in the second goal, playing Ronaldo into the area and he squared for Argentine striker Higuain to roll the ball home in the 88th minute.
Real finished with 10 men after Angel Di Maria collected two yellow cards in the same incident as he held up a Depor free kick at the end.
"Things are getting better for me," Kaka told reporters. "The boss needs me now and I have to be in good shape for the crucial part of the season."
Earlier, Brazilian striker Jonas scored twice as Valencia came back from 2-0 down to draw 2-2 at Real Zaragoza and move up to fifth on 41 points.
They are one point behind fourth-placed Malaga, who visit Real Betis on Sunday.
Valencia were undone twice in the first 32 minutes at the Romareda with Helder Postiga causing them all kinds of problems.
Apono netted from the penalty spot after Postiga was brought down in the area in the fifth minute, and the Portugal forward nodded in the second at a free kick.
The visitors found a lifeline when Jonas turned in Aly Cissokho's low cross in the 36th minute and, as Zaragoza tired, the same player volleyed the ball in after a free kick was headed across the goal in the 69th.
Valencia then hit the crossbar and Zaragoza had reserve goalkeeper Leo Franco sent off for handling outside the area, leaving youth team keeper Pablo Alcolea to hold the fort for a tense last 13 minutes.
Struggling Real Mallorca slumped to a 3-1 defeat at home to Getafe despite Giovani Dos Santos' outstanding 24th-minute opener as they conceded three times in the last 20 minutes to stay second from bottom.