Both touchdowns came in the third quarter long after the contest had been decided.
Mcgahee finished with 76 yards on 12 carries.
Troy Smith scored once.
Ray Rice rushed for 166 yards on just 13 carries, scoring on a 59-yard, second-quarter run, while Billy Cundiff added two field goals for the Ravens (7-6), who have split their last four games and remain in contention for an AFC wild-card playoff berth.
Detroit's only points were courtesy of Jason Hanson's 22-yard, second-quarter field goal.
Daunte Culpepper had 135 passing yards with two interceptions, and Kevin Smith gained 69 yards on 21 carries for the Lions (2-11), who have lost three in a row.
Exploding whale video goes viral on Internet
Jordana Brewster on Paul Walker: 'He was an enormous presence in my life'