Shaun Hill went 14-for-26 with 222 yards and two touchdowns for the Lions (5-10), who rallied from a 10-point deficit in the final five minutes to win their third game in a row.
Chad Henne threw for 278 yards and a touchdown on 29-of-44 passing, but his two picks in the final quarter accounted for 10 points as the Dolphins (7-8) finished their home schedule with a mark of just 1-7.
Detroit was trailing by 10 points with under five minutes to play, but a Stefan Logan 23-yard punt return gave the team the ball at its own 47 and the next play saw Jahvid Best take a short pass down the field to make it a 27-24 game with 4:37 left.
Nathan Vasher then picked off Henne on a diving grab at the Miami 36 to set up Dave Rayner's 47-yard field goal to tie the game with 2:44 showing.
On the third play of Miami's next touch, Bess slipped on his route as Levy stepped up on the play for the pick, which saw him run down the left side before cutting back to the right on a 30-yard score to give Detroit a 34-27 lead with 2:11 to play.
Miami got down to Detroit's 28, but Vasher made a nice tackle on Ronnie Brown before he could get out of bounds and the clock ran out before Miami was able to get off another snap.
Detroit was forced to punt early on its first touch, but Bess fumbled the ball and Detroit recovered at the Miami 19. A 39-yard field goal from Rayner made it a 3-0 game.
After an exchange of punts, the Dolphins tied the game thanks to a 40-yard field goal from Dan Carpenter with 30 seconds left in the first quarter.
The Lions came right back to take the lead with a six-play drive that covered 80 yards with Brandon Pettigrew catching a pass over the middle on a 20-yard score for a 10-3 lead with 12:17 to play in the first half.
Miami came right back, though, and tied the game when Lousaka Polite took an inside handoff up the middle on a four-yard score to cap an 11-play, 80-yard drive that ate up over six minutes of the clock.
After another a pair of punts, the Dolphins found themselves with the ball at the Detroit 40 with 1:42 to play thanks to a 25-yard return from Bess. Miami quickly got into the red zone and faced a 1st-and-10 at the Detroit 13. Henne tossed a pass to the right corner that saw a Detroit defender tip the ball into the hands of Bess for a 17-10 lead. The play was reviewed to see if Bess stepped out of bounds prior to catching the ball, but the call on the field stood and the Dolphins took the lead into the locker room.
Detroit tied the game on its first touch of the second half. The 14th play of the drive saw Maurice Morris take a handoff around the left side and into the end zone on a five-yard score to make it 17-all with 5:49 left in the third.
The Dolphins had an answer to take the lead back. The 69-yard drive over nine plays was finished on a 1st-and-goal play at the one-yard line as Brown punched the ball into the end zone on second effort for a 24-17 advantage with just five seconds left in the third.
A Detroit three-and-out saw Miami get the ball back at its own 38 and the team made it a two-score game on a 28-yard field goal from Carpenter with 9:44 left to play.
Miami closes out the season at New England next Sunday...Detroit finished the road portion of its campaign with a mark of 2-6 and plays Minnesota at home next Sunday in the finale...The Dolphins had won five straight against Detroit prior to the loss...Miami totaled 425 yards of offense, compared to 275 for Detroit, and held the ball for over 37 minutes...Detroit had just 67 yards on the ground, led by Best's 24 yards on six carries...The Dolphins totaled 154 rushing yards, with Ricky Williams netting 71 on 14 carries...Pettigrew had four catches for 74 yards.