Cade Cunningham finished with a 15-point double-double and Malik Beasley led the Detroit Pistons with 20 points to defeat the Toronto Raptors 99-95 in NBA Cup group play action.