The Raptors appeared to have the victory in hand after Toronto star forward Kawhi Leonard drained the go-ahead basket with 44 seconds remaining. Leonard then blocked Hornets point guard Kemba Walker at the other end.
The Hornets got another chance after Leonard missed a shot with 5.8 seconds left. Raptors defender Pascal Siakam tipped the inbounds pass away from Lamb, who quickly ran after the loose ball in the back court as time was about to expire.
Lamb launched the 48-foot shot over Siakam as the buzzer sounded, clinching the Hornets' third consecutive victory.
"When I first shot it, it felt good, but in my head I was thinking, 'It's too good to be true if it does go in,'" Lamb told reporters. "I never in a million years thought it would go in. I thought it'd get close, but to see it go in, it was unreal."
His 48-foot buzzer-beater was the second-longest, game-winning buzzer-beater in the last 20 seasons, according to ESPN Stats & Info. Tyreke Evans drilled a 49-footer against the Memphis Grizzlies on Dec. 29, 2010.
Lamb had 13 points on 5-of-11 shooting against the Raptors. He is averaging 15.2 points, 5.8 rebounds and 2.1 assists per game this season.
Charlotte (34-39) is 10th in the Eastern Conference standings and trail the Miami Heat by two games for the eighth seed. The Hornets have nine games remaining this season.