The Tigers trailed the Eagles 3-1 in the sixth.
"We've had a lot of close games this year that we've come back and won, so we knew that one or two runs wouldn't be enough to beat us," said Lopez.
The Tigers outscored the visitors 3-1 in the sixth and seventh to tie the game at 4-4.
The Tigers had the bases loaded in the fourth but couldn't capitalize as Foster struck out and had the bags juiced again in the eighth but Bryan Seeger grounded out to end the inning.
Keeping Santa Fe Christian in check offensively over the last four innings was Aaron Hartsock, who took over in the sixth for the Tigers' starter, Seeger.
Hartsock only allowed three hits and one earned run and struck out five. He helped his cause by rapping two doubles and driving in a run.
"I think tonight, the defense was the key. The D is what won it for us. Offensively, we hit the ball pretty well and came through with some clutch hits," said Hartsock.
Imperial finished with eight hits.
After the Eagles scored two in the top of the second, Eddie Martinez drove in Brenden Lopez to cut the deficit to 2-1 in the bottom of the frame.
Matt Mitchell scored in the sixth for the Tigers on a Hartsock double. Hartsock later scored on a Martinez sacrifice.
Down 4-3 in the bottom of the seventh, Seeger scored on a Lopez single to force extra innings.
"I really think that our kids are starting to come together now. Really, what we have here is a group of kids with no stars on the team," said Imperial coach William Estes. "This is a very fundamental squad offensively and defensively. We have no superstars on this team. We just have 13 kids that like coming out to practice and like playing the game. They just really have bought into this program."
Next will be the continuation of the Imperial Valley League as the Tigers (8-6 overall, 0-2 IVL) play at Calexico at 4:15 p.m. Tuesday.
"This was a big win for us," said Lopez. "We're peaking at the right time going into league."
Added Hartsock: "This was definitely a big win for us with league starting up again. Hopefully this will carry over so we can go into league and get our first win."