Flacco threw for 299 yards and two touchdowns while the highlight of the night came when Ed Reed took an interception 34 yards for a score.
The Ravens were pegged back to 17-13 but they pulled away by scoring 26 unanswered points thereafter, with Ray Rice running in two short touchdowns.
Dennis Allen's first match in charge of the Oakland Raiders ended with a 22-14 defeat against the San Diego Chargers, who did not concede a touchdown until the final minute.
Malcom Floyd touched down from Philip Rivers' six-yard pass and Nate Kaeding kicked five field goals to give the Chargers a well-deserved victory.
The Raiders were hoping to get Allen's tenure of to a positive start but were largely repelled by a stoic San Diego defence.