The 35-year-old Croat joins retired players Goran Ivanisevic and Andy Roddick as the only three men to serve at least 9,000 aces in their careers.
''Now I'm in the club,'' Karlovic said. ''It's definitely one of my goals to be No. 1 in all aces. This year, maybe, I will do it.''
Ivanisevic holds the record with 10,183 aces. Roddick, the former top-ranked American, trails with 9,074.
Karlovic had 27 aces Monday to take his tally to 9,022.
Needing five aces to reach the milestone, Karlovic only needed two service games to get there. He hit two aces in his first service game, then dug out of a 0-40 hole in his second.
In 2014, Karlovic put up a tour-leading 1,185 aces for the season.
Gasquet, the highest-seeded player playing on the opening day, led 4-2 in both sets but dropped serve at 5-4 in the second set.
The Frenchman closed out the match with a backhand crosscourt winner.
Dustin Brown of Germany, Simone Bolelli of Italy, Fernando Verdasco of Spain and Ivan Dodig of Croatia also advanced to the second round.
Top-ranked Novak Djokovic and Rafael Nadal enter play on Tuesday.