Flacco's third touchdown toss of the game, a 31-yarder to Mark Clayton at 2:06, sent the Ravens ahead and McGahee got his second score of the contest on a 1-yard-run with 11 seconds left.
The Ravens (1-0) set a single-game franchise record with 501 yards total offense.
Flacco connected on 26-of-43 passes for 307 yards.
Astronomers offer more expansive view of universe
Duggar sisters unveil Christian dating rules in new book