Ramsey smashed a sitter from a few yards out and Giroud headed the game victor off the crossbar.
Shinji Okazaki cancelled out Lacazette's opener with a close-range header after Maguire had been left unmarked to nod Marc Albrighton's deep cross back across goal.
Arsenal dramatically scored two late goals thanks to Aaron Ramsey and Olivier Giroud as the club got off to a great start.
"Well if you were a manager and you would be on the bench when you're 3-2 down with 20 minutes to go, and you win 4-3, you're more happy than concerned", he said. And in the end he chose to stay and it was one of the great days of the recent weeks for me.
The fans will hope that the striking symbolism - Lacazette scoring Arsenal's and the EPL's first goal of the season on his debut - is an omen for good things to come this season.
"He is really loved here, we love him and, in the end, he made a decision to stay".
Arsenal is not just pursuing a first league title since 2004 but also a return to the top four - and Champions League qualification - after finishing fifth in May.
In stark contrast to his vast riches in attack, Wenger had far less to be satisfied with defensively, with the absences of Laurent Koscielny, Shkodran Mustafi and Per Mertesacker leaving youngster Rob Holding exposed. We're disappointed to score three and come away with a defeat. We have a game backed on mobility and technique and I think he can integrate that well.
"And you could see that this team has quality and is used to playing together, but [we had] 70 per cent possession with 27 shots on goal.
Tonight we needed this win and everyone knows the first game is important for the confidence".