The Irn Bru First Division side dominated and made the majority of chances and pulled ahead from a Michael McGowan corner after the break to book their place in the third round of the tournament for the first time in six years - while the Highlanders are still searching for their opening win of the season.
Inverness manager Terry Butcher made four changes to his team for the trip to Somerset Park, handing starts to goalkeeper Jonathan Tuffey, defender Ross Tokely, Shane Sutherland and Aaron Doran.
That saw Ryan Esson, Andrew Shinnie and Nick Ross drop to the bench and Greg Tansey drop out of the squad.
Ayr controlled the first half, and McGowan tested Tuffey after five minutes with a shot from the left edge of the box which curled narrowly beyond the opposite corner of the stretching Inverness keeper's goal.
Injuries forced both sides to make substitutions in the first quarter of the game, with Martyn Campbell lasting just nine minutes for the hosts, later being followed down the tunnel by Jonny Hayes for the visitors.
Between those incidents, Sutherland had Inverness' first shot on goal when he pulled an effort wide of the right-hand post.
McGowan had two more excellent efforts before the half-hour, first with a diagonal shot which was cleared in the nick of time by Thomas Piermayr just as it looked set to roll into the net; then a 25-yard free kick which whistled narrowly past the right-hand post.
Doran replied moments later with a similar set-piece from the edge of the box which had Kevin Cuthbert stretching as it went narrowly over.
McGowan twice drew good saves from Tuffey after linking with Andy Geggan down the right, while Inverness saw their last attack of the half cut out by a timely tackle by Malone when substitute Ross was in possession on the six-yard line.
The SPL visitors made a brighter start to the second half when they earned a first-minute corner and, at the team's third attempt to turn the ball goalwards, Tokely hit the left-hand post with the ball running along the line into Cuthbert's arms.
Gareth Wardlaw thought he should have had a penalty in the 52nd minute after falling in the box under Graeme Shinnie's tackle, but instead the home forward earned only a booking.
Tuffey again had to come to Inverness' rescue after 59 minutes by stretching to tip a diagonal McGowan effort over the left corner of the woodwork.
However, Ayr finally took a deserved lead from the subsequent corner, delivered by McGowan and confidently rifled home from six yards by Malone.
Inverness had their share of possession and several corners after the goal but never really looked likely to equalise; substitute Andrew Shinnie sent a volley wide but they were otherwise denied by stout defending.
Instead, Ayr could have made it two with a quarter of an hour remaining when John Robertson's free-kick from the right was headed narrowly wide by Chris Smith, while Cuthbert later reacted well to save at close range a Richie Foran header.
Inverness thought they had scrambled a late equaliser when Tokely put the ball in the net on the stroke of full-time from a Doran cross, but the offside flag was raised to dash Highland hopes of extra time.