WEST SPRINGFIELD — The Northampton girls basketball team’s contest Wednesday night at West Springfield was the exact kind of trap good teams fall into and potentially great teams overcome.

The Blue Devils, who have talked all season about winning championships, were playing on the road in a brutal place to play against a team that makes its opponents work extremely hard. They were playing the night after a lopsided victory and had already beaten the Terriers earlier in the season.

Northampton shook off a sluggish start and dominated the final three quarters en route to a 54-31 win.

“I was real proud of our perseverance,” coach Perry Messer said. “We got down and nobody panicked. We know what we have to do. We have to grind and do it on the defensive end. I’ll take our defense with anybody in western Mass. We can make stops and make it hard for anyone.”

The Blue Devils (16-3, 9-2 Valley Wheel) wrap up their regular season Monday at home against Ludlow. A win in that contest will clinch at least a share of the league title and could put the finishing touches on a No. 1 seed in the Western Massachusetts Division 1 Tournament.

Northampton had eight days off following a surprising 45-42 loss to East Longmeadow on Feb. 4 before Tuesday’s 59-41 win against Minnechaug.

Practice over that break “was really hard,” said Susan Bell, who scored a season-high 13 points in the Wednesday’s win. “We focused on most of the things that we needed to, like execution on offense, working hard on defense and getting ready for the rest of the season.

“It was definitely a way to prepare ourselves for the tournament. That long week reminded us of what we needed to do to get it done and make it further in the playoffs.”

The loss to the Spartans ended an 11-game winning streak for Northampton.

“Sometimes going into the tournament and getting beat by someone, you realize what that tastes like and it doesn’t sit well with your,” Messer said. “I think that’s the thing I love about these kids. They have a lot of pride. They knew they messed up (against East Longmeadow) and the only way you get back from that is hard work.”

Things didn’t look positive early Wednesday, as turnovers put the Blue Devils in a 12-7 hole after the first quarter.

West Springfield added an early basket to open the second quarter, but Northampton took over from there with a 23-5 run going into halftime.

Maya Kerstetter scored 10 of her game-high 16 points during the frame, which also featured an offensive adjustment to deal with the Terrier’s box-and-one defense on standout guard Anna Walther.

“I told our guys that basically they are telling you that they are going to stop this one player and that their other four players are better than our other four players. And that’s not true,” Messer said. “Our four players are as good anybody out there.”

Messer moved Walther, the team’s point guard to the high post.

“Then, it’s just like any other zone offense,” he said. “The guards have to be ready to pinch seams and shoot the ball. If you want them to sit in the zone all game, don’t shoot the ball well.”

Walther (14.1 points per game) finished with a season-low five points, but had 13 rebounds and seven assists in the victory.

“There are going to be nights when you aren’t scoring,” Messer said. “There are other things you can do on the court to help us win. And she did a good job of rebounding and distributing the ball.”

Charlotte Maurer added four points and nine rebounds in the win.

The Northampton offense went dry early in the third quarter, as a Bell 3-pointer was the team’s only basket for the opening 6:16. Over that time, West Springfield cut the deficit to 33-27, but Nadine Harris (five points) responded with back-to-back deep jumpers — one a 3-pointer — with 1:22 left to push the lead back to double digits for good.

“I’m very happy about our outcome,” Bell said. “We were kind of nervous coming in because we know they are a very good team and they play hard in every game. We knew what we had to do.”

Jim Pignatiello can be reached at jpignatiello@gazettenet.com. Follow him on Twitter at Twitter.com/GazetteHS.