The Kirkcaldy side pressed their Angus hosts for long spells but fell behind to a Ross Caldwell penalty.
Then, after having twice found the net only for their efforts to be ruled out, the Fifers salvaged a draw with a stunning Declan McManus free-kick.
Raith were roared on by a noisy travelling support and dominated much of the early proceedings.
They also had the ball in the Brechin net in 14 minutes, only for the effort to be ruled out by referee Don Robertson.
A deep free-kick by Kyle Benedictus was headed in by Rovers defender Jean Yves M’voto and he wheeled away in celebration.
But his joy was short-lived as he was adjudged to have fouled keeper Graeme Smith in the build-up and the effort was ruled out.
Brechin grew in confidence as the game went on and only a goalline saving clearance by Jason Thomson prevented Andy Jackson from converting Elliot Ford’s cross.
Then came the game’s first flashpoint as former Hearts star Rudi Skacel went in hard in a challenge on Brechin’s Paul McLean.
City boss Darren Dods called for a red card but match official Robertson let Skacel off the hook with a yellow.
There was further controversy just before half-time as Craig Barr fell easily under the challenge of James Dale in the box.
Barr pleaded with Robertson to award a penalty but his appeal was waved away.
Within minutes, Brechin were awarded a penalty at the other end as striker Jackson was brought crashing to the deck by M’voto.
Caldwell coolly stepped up and sent Rovers keeper Connor Brennan the wrong way from the spot.
Within seconds Raith had another effort ruled out with Skacel heading in a Thomson cross only to be flagged offside.
Rovers struggled to find a way past Brechin for much of the second half and it took a strike of real quality to beat City keeper Graeme Smith.
That came on 72 minutes as McManus stepped up to chip a 25-yard free-kick into Smith’s top left corner of the net.
John Hughes’ side now looked the most likely to snatch a first-leg lead and they were inches away from making it 2-1 on 83 minutes as Chris Johnston’s cross just evaded Danny Handling and Craig Barr.
The final seven minutes of the game was played out in the Brechin half with Rovers sensing a chance to win on the night.
However, try as they might, they couldn’t get the crucial second goal and the sides will now meet on Saturday at Stark’s Park with the tie on a knife-edge.