Centre-forward McGrath, 20, netted for the eighth game on the bounce and midfielder Fraser MacLeod also got on the scoresheet to see off Lossiemouth 2-0 on the road at Grant Park on saturday.
McGrady scored just ahead of half-time, that goal being his 11th in his last eight matches, and MacLeod, 21, doubled City’s advantage on 68 minutes.
Missing four players, City manager Andy Kirk was forced to ring the changes, with striker Ryan McInnes recalled from loan at Scottish Junior Football Association Midlands League outfit Broughty Athletic to take up a place on the bench.
Dean Easton continued to deputise for regular goalkeeper Lenny Wilson in the competition, going on to pick up first competitive clean sheet, and Michael McArthur and Ewan Loudon also came into the starting 11.
Five minutes in, City conjured up the first real opportunity of the game when Marc Scott teed up Jamie Bain on the edge of the box but he couldn’t keep his shot down.
Five minutes later, Kevin McHattie attempted one of his trademark thunderbolts from range but his effort also flew over.
Chances were few and far between during a poor first half, the Coasters’ first real effort on goal arriving four minutes before the break as Easton comfortably gathered a long-range effort from Niall Kennedy.
Just as the game approached half-time, City broke the deadlock via McGrath, the ex-East Craigie striker latching onto a pass inside the box and angling a shot into the far corner past Logan Ross.
Five minutes into the second half, City ought to have made it 2-0 when a low cross from McGrath found Scott unmarked eight yards from goal but he screwed his effort wide.
On 65 minutes, despite McHattie appearing to have been fouled in the build-up, Ryan Stuart fired over the bar for the hosts. The City defender was given a yellow card by referee Gordon Seago for his protestations.
Shortly afterwards, City got their all-important second goal to effectively put the tie out of Lossie’s reach, MacLeod turning his marker inside the box before firing low beyond Ross.
It could have been 3-0 on 74 minutes when Scott’s cross found McGrath in the penalty area but Ross did well to get his fingertips to the ball.
With quarter of an hour remaining, the introduction of McInnes, 17, for Scott saw a tiring Coasters defence stretched further still.
Michael McArthur, making just his second start for the club, fired over the bar from range before Kieran Inglis guided a header just wide of goal.
City kept pushing for another and McGrath was twice denied by the feet of Ross in the Lossie goal as he chased his second of the afternoon.
The home side rallied late on as they searched for their first goal against City in four matches, with Easton pushing away a rasping effort from Ryan Farquhar.
City will come up against either Inverurie Locos, Buckie Thistle or Banks o’Dee in the semi-finals.