He added 11 assists and 10 rebounds.
LaMelo Ball collected 16 points and six rebounds and Gordon Hayward added 15 points for the Hornets, who have lost five in a row.
Fox (31 points, 11 assists) scored the final seven points for the Kings, who trailed 128-123 with 1:17 left.
Martin added 15 points -- all in the first half -- and Jae'Sean Tate added 16 for the Rockets, who committed 13 of their 19 turnovers in the second half.
Bojan Bogdanovic, Detroit's most prominent trade chip ahead of Thursday's deadline, led the Pistons with 15 points.