Saints had trailed 14-6 at the break at Parc y Scarlets, but tries from prop Soane Tonga'uiha and Foden, plus a 17-point contribution from the boot of fly-half Stephen Myler, secured a win that keeps the Premiership side in with a chance of dropping into the Challenge Cup.
Foden was a prominent presence throughout and he capped a superb individual performance with two telling contributions at the denouement of an absorbing contest.
With the score at 22-17 in the visitors' favour, but with the Scarlets hammering away desperately searching for a try that would preserve their Heineken ambition, Foden firstly made a superb covering tackle to deny opposite number Liam Williams in the left-hand corner.
And he followed that up by intercepting a pass from Scarlets replacement Rhodri Williams to race the length of the field for the clinching score from the final play of the game.
The excellent form of Harlequins' Mike Brown means Foden is facing a genuine challenge for his England spot, but the quality of his display will not have gone unnoticed by England coach Stuart Lancaster.
Mallinder said: "He is a quality player and it's not the first time he has played so well, I think it shows what a world-class player he is in attack and defence.
"It made a difference having Ben at full-back today, we know the Scarlets have a very good kicking game, and having him and our two wingers (Chris Ashton and Vasily Artemyev) playing really well meant our back three was a lot safer."
The win also saw Northampton gain revenge for the 28-23 defeat they suffered at the hands of the Scarlets earlier in the pool stage, as well as ending the Welsh side's Heineken Cup aspirations, and Mallinder was delighted with the character his side showed in dealing with a ferocious late onslaught.
"We said we were disappointed with the manner of how we lost to the Scarlets up at Franklin's Gardens and we wanted to put that straight," he said.
"It was a good game, there were opportunities for both sides but we were pleased to hold out and it was a tremendous defensive effort at the end to keep the Scarlets out.
"At half-time we said 'let's keep playing'. We had the breeze in our favour in the second half , we talked about putting the ball in behind them, getting the ball off the field and putting their line-out under some pressure and we did that well."
The Scarlets had carved out their 14-6 lead through a try for wing Vili Iongi, beautifully crafted by fly-half Rhys Priestland, who also kicked nine points.
But Northampton's forward power gave them a vital edge in the second half and a further penalty from the Wales fly-half was not enough to save their hopes of advancing in Europe's premier club competition.
Head coach Nigel Davies said: "We played with good intent and spirit, the intensity was good and you couldn't ask much more from the players in terms of commitment, but we were a little bit inaccurate and didn't take the opportunities which were presented to us.
"There were more than a couple of chances near the end. I though the boys were fantastic in their work-rate but just have to be a little bit more clinical in this level of tournament.
"We didn't start the second half particularly well, we couldn't get out of our own territory and that's where they got their points. We were chasing the game after that. We had to be very accurate and we weren't."
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
$29.99
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.