Queen of the South 1 Hamilton Academical 1
But Hamilton manager Billy Reid was disappointed that his side hadn't edged into the next round at their first attempt.
He said: "We had the edge on Queens with our goal just after the break, and I felt we were dealing confidently at anything Queens could throw at us.
"But then came that goal and it gave us an anxious final few minutes."
The goal followed a free-kick on Queens' left as Willy Gibson swung over the ball and it seemed to be going past until Stuart Robinson managed to hook it back into the middle. Derek Lyle out-jumped the Hamilton defenders to head home the vital counter - his first goal in six games.
Earlier, Hamilton had weathered an early Queens' flurry before the game livened up within minutes of the break.
Keeper Ritchie Barnard produced a fine save to turn away a shot from Scott McKenzie.
Then just 45 seconds into the second half, Brian Carrigan took a free-kick mid-way in Queens' half and lofted the ball into the penalty area where the unmarked Mark McLaughlin headed well beyond the keeper's reach.
Queens' boss Ian McCall said "I thought we had the better chances overall and was disappointed to concede such a soft goal.
"After the equaliser I thought we just might edge it, but I was happy with the draw."