DALLAS, TX --A decade's worth of playoff experience has taught Dirk Nowitzki plenty about hardship. Jason Kidd knows it well, too. Now, it's starting to look as if the tide has turned for the Dallas Mavericks. Nowitzki scored 40 points, Kidd hit the go-ahead 3-pointer with 40 seconds left in overtime and the Mavericks rallied from a 15-point deficit in the final 5 minutes of regulation to stun the Oklahoma City Thunder 112-105 on Monday night and take a 3-1 lead in the Western Conference finals. "It's just a bunch of veterans with a lot of unique stories. A lot of guys have been through a lot in this league and have been around forever," Nowitzki said. "A bunch of guys have been to the finals. ... Ultimately, we have one goal and we came together and fought through some stuff." Already with an improbable sweep over the two-time defending champion Los Angeles Lakers under their belts, the Mavericks came back from a 99-84 deficit with 5 minutes left in regulation to move within one win of the NBA finals. They handed the Thunder their first consecutive losses of the postseason and first back-to-back home losses in six months to earn a chance to clinch the series on their home court in Game 5 Wednesday night in Dallas. "We worked really hard these two games to win, and none of that guarantees anything for Game 5. We know that," said coach Rick Carlisle. The Mavs have won at least 50 games in 11 straight seasons with no titles and only one trip to the NBA finals to show for it. "All of us involved with this team have been through a lot of these wars," Carlisle added. "We understand our position that we're in. We respect it. We're very humble about it. We've got to get ourselves revved up and ready for Wednesday, because that's an opportunity." Dallas didn't lead until Nowitzki hit two free throws 16 seconds into overtime, and the Mavericks never let the Thunder -- who were one win shy of tying an NBA record with eight OT wins in the regular season -- go ahead after that. Kevin Durant, the league's scoring champion the past two seasons, missed a 3-point attempt on Oklahoma City's opening possession of overtime, then didn't get another shot until he missed from long range off the front of the rim in the final 10 seconds with the Thunder down by five. Durant finished with 29 points and 15 rebounds, and Serge Ibaka had 18 points and 10 boards for Oklahoma City. Russell Westbrook added 19 points, eight rebounds and eight assists. Only two teams in NBA history have come back from 3-1 deficits without the benefit of home-court advantage in Game 7 -- Houston in the 1995 West semifinals and Boston in the 1968 East finals. "There's no doubt it was a tough loss," Oklahoma City coach Scott Brooks said. "If this loss did not hurt, there's no such thing as a loss that can hurt you." Durant said all the Thunder can do now is try to be positive. "It's not over yet," he said. "We know we have a game on Wednesday. We've won in there before, so we've got to try to do it again." Durant had nine of the Thunder's 26 turnovers, including the one that led to the big shot by Kidd. Kidd stripped him as he went up for a shot with just over a minute left in overtime, then took a pass from Nowitzki, pump-faked to get Westbrook in the air and stepped up to drill a 3-pointer that put Dallas up 108-105 with 40.3 seconds left. Jason Terry hit two free throws for the last of his 20 points, and Kidd added two more to provide the final margin. Kidd -- who went to the NBA finals twice with New Jersey but is still seeking his first ring at age 38 -- scored 17 points to go with seven assists, five rebounds and four steals. "Everybody asks questions about the age and all that other stuff," Carlisle said, "but the thing I'd say to anybody is, `Never underestimate greatness."' The Mavericks also know better than to underestimate any opponent in any circumstances. "I think they're going to come back in Game 5 and going to throw everything at us. Obviously they're desperate now," said Nowitzki, who still laments how Dallas won twice to start the 2006 finals then lost four in a row to Miami. "But they showed they can win on our home court -- they stole Game 2 there -- so you know they are still confident. We've got to take it. Nothing is going to be given to you in this league, especially not in the playoffs." The Thunder learned that the hard way. Durant acted as though he was slapping on a pro wrestling championship belt after his 3-pointer finished Oklahoma City's second 7-0 run of the fourth quarter to make it 99-84 with 5:06 remaining. He hadn't won anything yet, though. James Harden fouled out 32 seconds later, robbing the Thunder of their third-best offensive player. Westbrook had the only basket for the team's All-Star tandem over the final 10 minutes while Nowitzki took charge. "It was almost over," Nowitzki said. "If we mess up one more time or give up one more offensive rebound, that would have been the game. So we couldn't afford any mistakes down the stretch and ... we were almost perfect." The big German scored 12 points during the Mavs' 17-2 run and got fouled by Nick Collison before hitting both free throws to tie it at 101 with 6.4 seconds left. Shawn Marion blocked Durant's 3-point attempt at least 30 feet from the basket with 2 seconds left, and the Mavs couldn't convert a chance at the win when Kidd's inbound lob with 0.7 seconds to go hit the rim. Oklahoma City came roaring out of the gates after trailing by as many as 17 points in the first quarter of Game 3. The Thunder hit their first nine shots and took an 18-8 lead after Durant caught a deflected inbound pass and zoomed in for a right-handed jam. They never quite could shake Dallas, though. The Mavericks were still within five at halftime and trailed 79-77 in the final minute of the third quarter. "It goes without saying that it was a tough loss to accept," Brooks said, "but it is a loss and we have to learn from it." Notes: Mavs C Tyson Chandler was called for a technical foul in the third quarter. The NBA rescinded Chandler's first two technicals in this series, so his postseason count is currently at four -- three shy of what's needed for a one-game suspension. Westbrook has five. ... Dallas was the only visiting team to win twice in the regular season at the Oklahoma City Arena, where the Thunder were 30-11. The Mavs are 4-0 in the building in the regular season and playoffs. ... Brooks, facing repeated questions about his starting lineup, says he's sticking with it. "We're a young team," he said, "and if you give a young team instability, you're going to get very inconsistent results."