Barnsley will play against Coventry City or Hartlepool United at home in the FA Cup third round on January 4.
The Oakwell club beat Burnley, Hull City and MK Dons in the FA Cup last season before losing 5-0 at Manchester City at the Etihad Stadium in the fifth round.
The League One Sky Blues and Hartlepool, of League Two, drew 1-1 on Saturday and will replay their second round match at Sixfields in Northampton next week.
Reds captain Martin Cranie used to play for Coventry as did goalkeeper Luke Steele while the Midlands side currently have Chris Dagnall on loan from the Reds. Hartlepool have former Barnsley players Scott Flinders and Neil Austin while their assistant manager Craig Hignett also played for Barnsley.
Barnsley were the first name out of the hat in the draw on Sunday.