The Light Blues were already set to face Forfar four times this term after triumphing in the Third Division last season and now have a cup clash to look forward to at Station Park.
Ally McCoist's men - who were unseeded for the draw - exited last year's competition at the quarter-final stage to Inverness and will be hoping for a better run this time.
The draw at Hampden also sees Queen of the South face Annan in a local derby, while newly-promoted top-flight side Partick Thistle take on Ayr United.
Most of the ties are to be played on August 3, although Thistle's match will need to be moved to a midweek date as they begin their league campaign against Dundee United on August 2.
- Sports & Recreation