NBA: Raptors perform heroic return to beat Mavericks