The Knicks came to Texas a train wreck. They will leave the Lone Star State bagging their season’s two biggest wins and return home with one newly resuscitated player in Iman Shumpert and a healthy Carmelo Anthony.

For all their off-court finger-pointing after their heartbreaking two-point loss in Houston on Friday night, they didn’t carry the bad karma onto the American Airlines Center court. The Knicks wound up just one missed J.R. Smith 3-pointer away from sweeping the Texas Triangle.

Instead, they go a sturdy 2-1 after their victory Sunday night over the Mavericks when the Iman Shumpert Texas Revival tour arrived late, but right on time to save the Knicks in a 92-80 victory.
The Knicks (11-22) nearly blew a 14-point fourth-quarter lead, but captured the victory despite having center Tyson Chandler go down with an upper-respiratory infection in the first quarter.
“It’s big for us,’’ Shumpert said. “Hopefully the Garden will be crazy when we get home.’’

In 14 trips, it was only the fourth time the Knicks have posted a winning record on the Texas Triangle journey.

“It’s big time — I thought this trip was very productive,’’ said Anthony, who returned from a three-game absence in San Antonio and lit a spark. “We had a chance to go undefeated on this trip, but we’ll take 2-1. I don’t think anyone predicted we’d get two wins on this trip.’’

With the Knicks going cold and Anthony out of rhythm offensively since the first quarter, Shumpert entered with 3:18 left in the fourth quarter after Amar’e Stoudemire hurt his hip after taking an elbow from Jose Calderon.

With Anthony double- and triple-teamed, Shumpert scored the two biggest baskets after Dallas had cut the lead to six with 2:43 left on a Calderon trey. He snaked in for a reverse layup on a baseline drive past Dirk Nowitzki and buried a left-wing 3-pointer that drove the lead back up to nine points with 1:13 left.

“Melo found me when I was open, I think they just forgot about me and left me over there,’’ Shumpert said of his big 3-pointer. “I was just open. When you’re open, you have to knock down shots. [On the drive], I just saw Dirk standing straight up. He thought I was going to settle for the 3. That was my scouting report after the last two games.”