The former Arsenal defender volleyed in a cross parried by Malaga goalkeeper Carlos Kameni for the 73rd-minute winner.
Kameni had denied Lionel Messi on several occasions as he tried to replicate his two clean sheets against Barcelona from last season.
Barcelona, which won 1-0 at Athletic Bilbao in round one, opened up a provisional five-point gap over Real Madrid before it hosts Real Betis later.
Vermaelen started in place of the suspended Gerard Pique, and his goal marks quite a turnaround for a player who only appeared in the final league match of last season because of nagging injuries that had previously limited him in England.
Barcelona dominated possession throughout, but the closest the hosts came in the first half was when Javier Mascherano headed Messi’s left-flank cross off the bar in the 26th.
Malaga packed its area with defenders but ventured out on counterattacks. Barcelona’s Sergi Roberto was playing out of position in place of injured right back Dani Alves and did well getting back as a last man to intercept Roberto Rosales’ pass for Duje Cop in the 52nd.
Neymar, who played his first game of the season after recovering from the mumps, focused on setting up Messi and almost assisted him twice near the start of the second half.
But Kameni was up the task when he stopped Messi with his seventh, eighth, ninth and 10th saves of the night as Barcelona pressed for a breakthrough. It finally came when Kameni parried Luis Suarez’s cross and Vermaelen used his left boot to sweep it home.
Malaga’s Charles could have snatched an injury-time equalizer, only for the substitute to scuff his shot from close range.
David Moyes’ Real Sociedad is still searching for its first victory— and its first goal— after the Basque side drew 0-0 with Real Sporting.
For Sporting, the point away from home was a second good result for the promoted club, which also held Madrid 0-0 last weekend.
Celta Vigo also hosts Rayo Vallecano later.