Lacazette's powerful late winner proved the difference in a contest full of attacking quality and defensive fragility.
The Gunners led twice, through Shkodran Mustafi's header and a curling effort from Pierre-Emerick Aubameyang, before Lacazette crashed home the winner on 81 minutes.
Victor Camarasa's first Cardiff goal, on the stroke of half-time, and Danny Ward's header had seemed like they would earn Neil Warnock's side a point as they scored their first goals of the league campaign.
Lacazette said at the final whistle: "For me, it was important to start well. I wanted to show to the coach I can be in the first 11, and we played well today so I'm happy. We saw some highlights from the goalkeeper, and I knew if I shot with a lot of power I could score so I did!
"Me and Auba get on well off the pitch and that makes it easier to play together, but it's not only him."