The Second Division side had goalkeeper Craig Nelson to thank for keeping Killie at bay in the first half but he could not produce more heroics after the break to deny Frazer Wright.
Killie's tensions were eased on 65 minutes when a stunning shot from Craig Bryson made sure of their place in Monday's draw.
Brechin created the first chance of the game after only eight minutes when former Airdrie striker Gary Twigg got himself on the end of a Kevin Byers cross and expertly lofted it over goalkeeper Alan Combe.
Twigg had turned to celebrate when the assistant referee called him back with a raised flag.
Killie knew they were in for a scrap at Glebe Park and were determined to get the opening goal to take the sting out of the game.
They almost did that after 13 minutes when Medhi Taouil picked out Wright inside the box with a free-kick but his powerful header was saved by goalkeeper Nelson.
Brechin almost snatched the lead 60 seconds later as they broke upfield, with full-back Willie Dyer feeding Twigg who clipped the ball through for Ian Diack, but his low drive through the six-yard box was too quick for everyone.
Nelson kept his side in the game on 16 minutes, this time diving to his near post to pluck the ball away after Allan Russell - making his Killie debut after injury - had planted a header goalwards.
The 37-year-old goalkeeper was in inspired form and made another crucial intervention on the half-hour mark when Bryson looked set to score with a drive from inside the area.
Russell's debut was curtailed at half-time as Willie Gibson was introduced to the action after the break.
Kilmarnock finally found the goal they so desperately needed after 58 minutes.
Taouil's free kick from the right caught Brechin completely square and they left Wright in far too much space, allowing him to slot a low shot beyond Nelson.
Kilmarnock's second goal came seven minutes later but this time Brechin did not need to beat themselves up about it because the strike was sublime.
Garry Hay linked well with Gibson on the left and Hay's low cross landed perfectly for Bryson, who flicked an unstoppable shot into the top corner.