QB Sage Rosenfels' attempt at a final drive ended in disaster when his overthrown pass was intercepted by young defensive back David Young.
The Dolphins dominated for the better part of the first half, with Jay Fiedler hitting Ricky Williams on a 4-yard touchdown pass and Olindo Mare adding two field goals, including a 51-yarder, to build a 13-3 lead.
But the second-team defense allowed Jacksonville to go 80 yards in the final minute of the first half, with rookie LaBrandon Toefield scoring from 2 yards out on the final play of the half to make it 13-10.
After Jacksonville tied the game in the third quarter, Mare gave the Dolphins the lead again with a 29-yard field goal before the Jaguars took the lead for the first time on Joe Smith's 3-yard touchdown run.
The Dolphins came back to take the lead for the last time when Leonard Henry raced around the left side for a 7-yard touchdown late in the third quarter.
The lead stood until Leftwich led the late Jacksonville drive. A big play on the drive was a penalty for hands to the face called on cornerback Alphonso Roundtree that gave Jacksonville a first down after they were facing a third-and-7.