Lacazette had gone eight matches without a goal before he put the Gunners ahead in the 10th minute on Friday (AEDT) with a stunning long-range strike.
Pablo Mari headed in the second from a corner before Eddie Nketiah finished off a stylish team goal a minute before half-time.
Arsenal, which had already qualified for the competition's last 32, conceded when Koya Kitagawa fired home early in the second half but Emile Smith Rowe added a fourth to stifle any hopes of a comeback.
Mikel Arteta made 11 changes from the side that lost 2-1 at home to Wolves in the Premier League last weekend and those involved made a high-tempo start.
Rapid carelessly lost possession from a throw-in and the ball bounced kindly for Lacazette, who struck a spectacular swerving effort beyond goalkeeper Richard Strebinger.
The Gunners gave the 2,000 fans permitted inside Emirates Stadium another goal to cheer after Reiss Nelson's corner was glanced into the net by the head of Mari.
Nelson cut the ball back for Lacazette, who was operating in a slightly deeper role, just before the half hour but this time he sent his effort against the post.
Arsenal left the Austrian side with a mountain to climb just before the interval when a slick passing move saw Nketiah nod the ball home after Strebinger parried his initial shot.
Rapid pulled a goal back two minutes after the break when the ball pinged around the area before it dropped to Kitagawa and he found home through a crowded box.
But Arsenal regained its composure and Maitland-Niles capitalised on another Rapid mistake to tee up substitute Smith Rowe to seal the win.