Rangers will travel to Dundee United in the fifth round of the Scottish Cup, while Celtic will face Raith Rovers if they overcome Arbroath.
United knocked Rangers out of last season's tournament, days before the Ibrox oldco club went into administration.
Celtic face a trip to Rovers, the team that shocked them in the 1994-95 League Cup final, should they get past Arbroath in a fourth-round replay.
Scottish Cup fifth-round draw:
Raith Rovers v Celtic or Arbroath
St Mirren v Cowdenbeath or St Johnstone
Dunfermline v Dumbarton or Hamilton
Hibernian v Aberdeen or Motherwell
Falkirk v Forfar
Dundee Utd v Rangers
Dundee v Turriff United or Morton
Kilmarnock v Ross County or Inverness
Ties to be played weekend of February 2 and 3
Source: team_talk