Tyrus Thomas' jumper with 1:20 to go in the game gave the Bobcats the lead for good at 91-89, and after Jerryd Bayless missed a 22-footer at the other end, Diaw got a feed from Matt Carroll for a lay-in to put Charlotte up by four with 44.7 seconds left.
D.J. Augustin then made three free throws in the final minute to maintain the lead for the Bobcats.
Mohammed grabbed eight rebounds, Diaw ended with nine points, seven rebounds, five assists and four steals and Gerald Wallace chipped in with 16 points in Charlotte's win.
The Raptors were led by Bayless with 17 points and nine assists and DeMar DeRozan contributed 14 points in the loss.