Ian McCall’s cinch Championship outfit will travel to Ibrox to take on Michael Beale’s men, while Celtic have also been handed a home draw after they were paired with fellow Premiership outfit St Mirren.
Hearts, who saw off Edinburgh rivals Hibs to progress in the competition, will take on Championship opposition as well after being paired with Hamilton Accies. John Rankin’s team caused the surprise of the round so far, overcoming Ross County on penalties in the fourth round.
Darvel or Aberdeen will play Falkirk at home – their match is due to take place on Monday night – while there is a repeat of this season’s Viaplay Cup quarter-final after Dundee United and Kilmarnock drew each other in an all-Premiership encounter.
Motherwell will head to either Linlithgow Rose or Raith Rovers, who are due to play on Tuesday, Livingston will host the winner of either Inverness Caledonian Thistle or Queen’s Park and Cove Rangers or Ayr United will face Elgin City or Drumchapel United.
The draw was made by Gordon Duncan and former Hibs manager Shaun Maloney, with a brief moment of comedy when Maloney got the No 9 ball confused as No 6.
The ties will be played over the weekend of February 11, with up to four matches being available for broadcast, two on BBC Scotland and two on Viaplay.
Scottish Cup fifth round draw (ties to be played weekend of February 11): Linlithgow Rose or Raith Rovers v Motherwell, Livingston v Inverness Caledonian Thistle or Queen’s Park, Dundee United v Kilmarnock, Hamilton Accies v Hearts, Celtic v St Mirren, Cove Rangers or Ayr United v Elgin City or Drumchapel United, Darvel or Aberdeen v Falkirk, Rangers v Partick Thistle.