Just when it looked like the Mavericks were going to be guilty of an unforgivable lack of effort against one of the worst teams in the NBA, Monta Ellis found a zone that he’d not been familiar with for quite some time.

The shots started to fall, the defense showed up at a timely moment and the Mavericks overcame another miserable rebounding night to run down the Los Angeles Lakers for a 100-93 victory Sunday night at Staples Center.

It wasn’t the prettiest win of the season, but certainly one of the most important as the Mavericks salvaged the finale of a three-game West Coast trip that started with lopsided losses at Portland and Golden State.

Ellis kept the Mavericks afloat with 18 third-quarter points, tying his highest scoring quarter of the season. He finished with 31 points.

Ellis was asked if he needed a game like this after going through a month when he was shooting under 39 percent from the field and a deplorable 13 percent from 3-point range.

“I never lose confidence,” he said. “It’s a long season. There’s 82 games. Sometimes you go through stretches. You just got to stay positive.