Ayling, who scored the winner in the corresponding fixture at Ashton Gate, had the final say after Anthony Wordsworth had cancelled out Aden Flint’s opener shortly after the interval.
Crawley’s leading scorer Izale McLeod got a clear sight of goal mid-way through the first half but fired a right-footed shot wide of goalkeeper Frank Fielding’s left-hand post.
Fielding then showed alertness to gather a testing deep cross from Gavin Tomlin before a shot from Mathias Pogba was blocked.
Visiting defender Richard Wood had the ball in the net for Crawley after 31 minutes, but was in an off-side position when he headed in a free kick from Lee Fowler.
Crawley goalkeeper Lewis Price blocked a shot from Luke Freeman with his legs before defender Flint headed City in front with his eighth goal of the season in the 47th minute following a cross to the far post by Freeman.
Midfielder Wordsworth, on loan from Ipswich, equalised for Crawley in the 59th minute by firing into the roof of the net from the edge of the penalty area after Sonny Bradley and Pogba had combined.
But defender Ayling clinched victory for City seven minutes from time by heading in firmly from Freeman’s corner.