McGrath dismissed Kevin Pietersen and Ian Bell in the space of four balls after tea as Australia threatened to rip through England's fragile batting line-up.
But the tourists, 4-0 down in the series and hoping to avoid their first Ashes whitewash in 86 years, fought back strongly in the final session to share the honours before bad light ended play early at the Sydney Cricket Ground.
England skipper Andrew Flintoff rediscovered his form with the bat to blast an unbeaten 42, while the reliable Paul Collingwood made a patient 25 not out.
The pair shared an unbroken partnership of 67 to rebuild the England innings after McGrath's double strike broke a 108-run stand between Pietersen and Bell.
McGrath, who is joining Shane Warne and Justin Langer in retiring from Test cricket after the match, dismissed Pietersen for 41 when the Englishman mistimed a careless pull to Mike Hussey at mid-wicket.
Then McGrath claimed a second wicket off the first ball of his next over when he bowled Bell for 71 as England slumped to 167-4 after losing their two openers cheaply.
Andrew Strauss departed for 29 before lunch then Alastair Cook fell for 20 in the third over of the afternoon session with the total on 58.
Early Movement: England's openers were given a tough workout in the first session as Australia's seamers made the most of a pitch that provided early movement after morning rain delayed the start by an hour.
Strauss and Cook survived the initial onslaught to put on 45 for the first wicket and provide England with their best start of the series before both fell in quick succession.
Strauss had escaped a series of close calls, including a dropped catch by Langer at third slip on 21, but his luck ran out when he gifted wicketkeeper Adam Gilchrist a catch with a reckless flash at Brett Lee.
Cook batted with greater caution despite playing and missing several times, only to succumb to a momentary lapse in concentration when he got a faint inside edge off Stuart Clark and Gilchrist took an acrobatic catch diving to his right.
The match began in emotional circumstances when McGrath, Warne and Langer led their team on to the field in front of a capacity crowd of 40,000 in their final appearances after more than a decade and a half each of international cricket.
The trio were unable to make an impact in the first two sessions as Pietersen and Bell rebuilt the innings with a steady partnership but McGrath made his presence felt in the last session.
There were some signs of concern when Pietersen and Bell departed in quick succession to expose England's middle-order but Flintoff signalled his intentions to take up the fight when he smacked Clark over the fence for six.