The AFC North side levelled the scores at the end of the first quarter when Flacco delivered the ball to his tight end Crockett Gillmore for a 26-yard score. However, the Raiders hit back as they notched another touchdown early in the second quarter as Latavius Murray found the endzone on the goalline.
Gillmore scored his second touchdown of the game when Flacco fired him in the ball five yards from the line and he bustled through two tackles to get into the endzone, but Janikowski restored the Raiders' lead with another field goal before the break.
There was still time for Tucker to kick another field goal before the half and he nailed his effort to level the scores.
In the second half, the Raiders managed to retake the lead when Carr moved his side into the range of Janikowski, and he made no mistake firing the ball through the posts from 48 yards.
The home side extended their lead to 10 points when Carr escaped the rush in the pocket and threw downfield towards Michael Crabtree, who was left uncovered as he made the grab for the 29-yard score.
Baltimore pulled themselves to within seven points when Tucker kicked his third field goal of the game from 37 yards in the fourth quarter.
The visitors proved their resilience by levelling the scores when Flacco moved them into the redzone, and then handed off to Lorenzo Taliaferro to run in for the seven-yard touchdown.
An interception from Will Hill handed the Ravens the chance to take the lead for the first time in the match, and Tucker secured the advantage for his side with a 31-yard kick.
Carr had time to win the game for the Raiders, although those hopes looked to have ended when Hill picked him off for a second time.
However, a penalty flag against the visitors kept their drive alive and Jack Del Rio's men secured the win when Carr delivered a dart down the seam for Roberts to make the game-winning score.