The Vikings trailed 16-0 until just before the break but then ran in five tries to end their lean spell after a thrilling contest at the Select Security Stadium.
Huddersfield led 16-4 at half-time with tries from Nathan Mason, Danny Brough and Joe Wardle and two goals from Brough, with the Vikings only reply a touchdown from Corey Thompson.
But Widnes fought back to lead 24-16 thanks to two tries from man-of-the-match Joe Mellor and others from Stefan Marsh and Thompson, Rhys Hanbury adding two conversions.
Jermaine McGillvary touched down for Huddersfield to cut the deficit to four points after 69 minutes but Widnes held on.
Afterwards, however, Anderson had no excuses, and said: “We got exactly what we deserved.
“At 16-0 up another score may have put the game to bed but we made too many individual errors and missed tackles.
“Where we are at the moment we cannot afford to be that sloppy.
“At half-time we spoke about doing the simple things right but undid everything we did against St Helens last week.
“It’s a fair wake-up call and a reality check. We have to be a lot better than that.”
Anderson’s opposite number, Denis Betts, admitted a sense of relief after his side’s thrilling comeback.
Betts said: “I thought we were the better team, even when we went 16-0 down.
“We just couldn’t get over the line.
“But we showed plenty of character, fight and desire and we needed a win, it us such a relief.
“We haven’t been playing badly but somehow still losing games.
“Now it will put some belief in our bellies for the next matches before the Challenge Cup quarter-final.
“We had been getting too anxious, but although it wasn’t pretty at times we looked more like the side we were at the start of the year.”
Betts paid tribute to Mellor, whose pace demoralised Huddersfield.
“He’s been searching for his game in recent weeks, like others, but he found his feet today,” said Betts.
“Gil Dudson carried the ball really well for us throughout and there was no lack of energy all round.
“We made a hash when Danny Brough scored his try but came back really well.”
Widnes Vikings: Hanbury, Thompson, Bridge, Runciman, Marsh, Mellor, Brown, Dudson, White, Cahill, Dean, Houston, Leuluai. Substitutes: Sa, Buchanan, Manuokafoa, Whitley.
Huddersfield Giants: Grix, Mason, Cudjoe, Connor, Murphy, Brough, Ellis, Crabtree, Hinchcliffe, McGillvary, J. Wardle, Ta’ai, Lawrence. Substitutes: K. Wood, Rapira, Roberts, Ikahihifo.
Referee: Chris Kendall (RFL).