That was one Houdini act the Dallas Mavericks pulled off Friday night at New Orleans Arena.

Down by four points with 55.5 seconds remaining in a game against New Orleans that was slip-sliding away, the Mavs stole a 104-100 triumph over the Hornets before of a stunned crowd of 16,538.

It was the Mavs’ fifth win in their past six games and padded their record to 25-29 going into Sunday’s nationally televised home game against the Los Angeles Lakers.

New Orleans sharpshooter Ryan Anderson barely beat the 24-second shot clock Friday and made a 3-point field goal that gave the inspired Hornets a 100-96 lead with 55.5 to go.

Undaunted, the Mavs first got a 3-pointer from Mike James with 42.8 seconds remaining to inch within 100-99.

Then, Vince Carter’s 3-point dagger with just 6.5 seconds left lifted the Mavs ahead 102-100 and had the reserves on the bench jumping for joy.

Afterward, Carter, who tallied 22 points, said: “You can’t be afraid to shoot it. If you feel confident, take the shot and, hey, shoot it.

“I’ve been around in many situations where I’ve taken the game-winning shot and missed it, and I’ve been in situations where I’ve hit big shots for our teams.