Holders St Johnstone will begin their defence of the Scottish Cup with an away tie against either Kelty Hearts or Montrose.
There was a mixed bag for the 12 cinch Premiership clubs who entered the draw for the tournament at the fourth-round stage, with the games taking place on the weekend of January 22, 2022.
Scottish champions Rangers, who last won the trophy in 2009, will be fancied to go through when they take on League Two side Stirling Albion at Ibrox.
Celtic, who have won the competition a record 40 times, are away to League One outfit Alloa Athletic.
There is an all-Premiership tie between Livingston and Ross County, while Motherwell are at home to Inverness or Morton.
Aberdeen host League Two outfit Edinburgh City, with last season’s beaten finalists Hibernian taking on either Cove Rangers or Queen of the South at Easter Road.
There will be plenty of interest in Ayrshire, with Ayr United drawn at home to St Mirren and Dundee United travelling to Kilmarnock, while West of Scotland Premier Division outfit Auchinleck Talbot, conquerors of Championship side Hamilton in the last round, will welcome Hearts.
North Superleague side Banks O’Dee, who beat League One East Fife to reach the fourth round, were rewarded with a home tie against Championship side Raith Rovers.
The draw in full:
Peterhead v East Kilbride
Clydebank v Annan Athletic
Banks O’Dee v Raith Rovers
Motherwell v Inverness/Morton
Kelty Hearts/Montrose v St Johnstone
Livingston v Ross County
Dumbarton v Dundee
Aberdeen v Edinburgh City
Rangers v Stirling Albion
Ayr United v St Mirren
Kilmarnock v Dundee United
Hibernian v Cove Rangers/ Queen of the South
Partick Thistle v Airdrieonians
Auchinleck Talbot v Hearts
Alloa Athletic v Celtic
Arbroath v Brechin City/Darvel