Holders Celtic will face Ross County in the last 16 of the Scottish League Cup, and League One side Falkirk will host Rangers.
There will be all-Scottish Premiership ties between St Mirren and Aberdeen in Paisley and Motherwell and St Johnstone at Fir Park.
And Hibernian and Dundee will meet again at Easter Road, having been in the same group.
The ties will be played on 28 and 29 November.
Aberdeen, Celtic, Motherwell and Rangers, who have been in European competition this season, enter as seeded sides at this stage.
The best four group winners - Hearts, Hibs, Dunfermline and Livingston - were the other seeded sides.
- Life After Reality TV: Love Island and basketball star Ovie Soko
- The Rap Game UK: The artists face their first challenge