The 28-year-old was the Catalan giants' big summer signing, costing Barcelona €40million from Valencia, and the forward showed why with a well-placed header on the hour, his first league goal in Barça's colours.
Argentina international Lionel Messi had opened the scoring on three minutes with a neat chip for his 131st club goal to surpass Brazilian great Rivaldo in Barça's goalscoring hall of fame.
Andres Iniesta, scorer of Spain's winning goal in the 2010 FIFA World Cup™ final, scored a sublime second with a side-footed volley before international team-mate Villa struck.
Messi, recovering from a disappointing World Cup with Argentina, scored 34 league goals last season and continued where he left off to get Barcelona up and running, racing onto a fine pass from Iniesta before coolly chipping over the goalkeeper with his right foot.
Iniesta took centre stage on 33 minutes, showing great technique to convert a volley from distance with goalkeeper Tono helpless after coming out to punch clear.
A minute later Racing were given a life-line with a fortunate penalty after Maxwell was penalised for shoving Francisco Perez in the box. Mohamed Tchite took the highly contested spot-kick but Victor Valdes dived to his right to save brilliantly.
Villa thought he had scored just before half-time but the effort was ruled out for offside. However, the Spain star, who scored five goals at the World Cup in South Africa, powered in a great header from a Dani Alves cross just after the hour mark to claim his debut goal.
Brazilian Adriano, a summer signing from Sevilla, made his debut eight minutes from time as a replacement for Iniesta, who was applauded off by the Racing fans.
Earlier, promoted Real Sociedad enjoyed a winning return to La Liga by defeating Villarreal 1-0 at their Anoeta stadium.
Midfielder Xabi Prieto scored the decisive goal on 57 minutes as second division champions Sociedad, back in the top flight after three seasons away, started their campign by taking all three points.
Newcomers Levante and Hercules both lost on Saturday, leaving Sociedad as the only promoted side off the mark.
Getafe pipped Villarreal to sixth place last season but a summer of departures has weakened their squad and the Madrid-based club fell to a 3-1 defeat at Espanyol.