Rovers slipped to their eighth defeat in 10 league games to plunge into the relegation zone and prompt McGhee's dismissal less than a year after his arrival. The 55-year-old saw his side ship four goals inside the opening 33 minutes to seal his fate.
Garry Kenneth's 14th-minute own goal was cancelled out by Tom Eaves a minute later but that was as good as it got for Rovers. Within four minutes they were 3-1 down to goals from Ashley Chambers and Jason Walker, while Chambers grabbed his second in the 33rd minute to secure York's third home league win of the season.
Gillingham retained their five-point lead at the top despite being held to a 2-2 home draw by Fleetwood.
The Gills had to battle back from 2-0 down as Junior Brown (20) and Alan Goodall (28) gave Fleetwood initial control. Charlie Lee pulled a goal back three minutes before half-time and Myles Weston snatched a point on 65 minutes.
Closest rivals Port Vale and Cheltenham failed to close the gap as they cancelled each other out in a 1-1 draw at Whaddon Road, while Rotherham edged up to fourth with a 1-0 win at AFC Wimbledon and Bradford could only draw 2-2 at Southend following their Capital One Cup heroics in midweek.
Phil Parkinson's side knocked Arsenal out on penalties to reach the semi-finals in midweek but their efforts seemingly proved costly as they conceded twice late on. Ryan Cresswell (80) and Gavin Tomlin (90) snatched a point back for Southend after they fell 2-0 down to Nahki Wells (28) and Luke Prosser's own goal (64).
Rochdale's poor run continued as they lost 4-2 at Aldershot. Daniel Lopez (eight), Peter Vincenti (39), Danny Rose (45, penalty) and Craig Reid secured the points for the Shots as Dale could only respond through Ashley Grimes' double (12 and 60). Ben Herd saw red for the hosts in injury time to provide the only sour note for the Hampshire side.
Barnet stayed bottom as Matthew Saunders' 17th-minute winner condemned them to a 1-0 defeat at Dagenham & Redbridge, while 10-man Wycombe won 2-0 at Accrington Stanley.
Exeter and Plymouth drew 1-1, while Morecambe, Chesterfield and Torquay all also drew 1-1 against Oxford, Burton and Northampton respectively.
- Sports & Recreation
- Ashley Chambers