Tom Brady sealed a crucial win for the Patriots after finding Chris Hogan for a 79-yard touchdown with 6:18 left in the fourth quarter.
The Ravens had moved to within three points of a remarkable comeback, after cutting a 20-point deficit in the second half to 23-20.
However Brady sealed a crucial win for the Patriots after finding Chris Hogan for a 79-yard touchdown with 6:18 left in the fourth quarter.
The touchdown put the icing on another vintage display from Brady, who made 25 of 38 throws while amassing 406 yards and three touchdowns.
The victory saw the Patriots improve to 11-2 for the season, leaving them on course to secure home field advantage through the AFC playoffs if they manage to win their final three games.
Brady had earlier recorded the 450th touchdown pass of his career, only the fourth player in history to reach that milestone.
However the Patriots were forced to sweat as Baltimore bounced back from a sluggish first half display to capitalise on a string of uncharacteristic errors from New England in the second half.
Rookie Cyrus Jones threw Baltimore a lifeline when a bouncing punt hit his foot for a fumble which left the Ravens in prime position for a touchdown.
Matthew Slater then fumbled a kickoff, setting up Ravens quarterback Joe Flacco for a touchdown pass.
A Justin Tucker 38-yard field goal left the score finely balanced at 23-20 and the momentum appeared to be with Baltimore.
But Brady's long bomb to a wide open Hogan put the Patriots clear once again.
A further Tucker field goal made it 30-23 with just over two minutes left.
From the ensuing onside kick however New England's Patrick Chung was able to recover, allowing the Patriots to run out the clock for the win.
The defeat leaves Baltimore at 7-6, one game behind the AFC North leaders the Pittsburgh Steelers.