Danny Orr began his spell as Castleford interim coach with a victory after his side recovered from 10 points down at the break to beat Widnes.
Tries from James Clare, Richard Owen, who scored a brace, Jordan Thompson and Adam Milner proved crucial, as did four goals from Jamie Ellis.
Widnes's tries came from Paddy Flynn, Rhys Hanbury, Jon Clarke, Cameron Phelps and Patrick Ah Van.
Ah Van could have levelled the scores, but dragged a last-minute penalty wide.
Widnes coach Denis Betts will be disappointed not to have earned a point, particularly as his players overturned a decision to kick for two points late on in favour of a chance for a try.
The victory ends a nine-game run without a win for Castleford, who having taken the lead early on faltered towards the interval but did not concede any points in the second.
Former player Orr took charge at Cas after former Wigan and St Helens coach Ian Millward departed on Tuesday.
The 34-year-old made 220 Super League appearances for the club during two spells.
It seemed Orr's appointment inspired the struggling Tigers, as they belied their poor form with a bright start.
After Michael Shenton was taken off following a collision in the tackle, the hosts scored two quick tries to delight the home crowd.
First Clare collected a kindly-bouncing kick ahead and shrugged off three tackles to score, and then a bullet cut-out ball from Jordan Tansey found Owen out wide for the second score.
It looked as though Castleford were on top but Chris Dean's turn of pace created the gap on the right, and he found the supporting Flynn to put Vikings on the board.
It was the first of four rapid-fire scores as Betts's side changed the complexion of the game.
Owen failed to gather a quick dummy-half pass from Milner to give Widnes territory and a set of six, and after Dean was held up Hanbury broke from dummy-half to score.
Alex Gerrard punched through a gap in the Cas line and had the presence of mind to feed Clarke for his try, and soon afterwards Phelps gathered a pass from Kevin Brown after Hanbury's burst through the centre created the position.
Errors from both sides punctuated the tries, notably when Brown's interference gave the Tigers a set close to the line, and once Weller Hauraki and Nathan Massey had softened up the defence, Rangi Chase looped a pass to Owen for his second.
Ah Van's try at the end of the half - a spectacular airborne dive for the corner - ended the first-half scoring, but the quality of England international Chase stood out in a gritty, hard-fought second period.
Frustrations and tempers boiled, with penalties on both sides, but Thompson made the most of Chase's clever kick to touch earlier in the set to bundle over and pull Castleford within four points.
New Zealand-born Chase was again pivotal as Castleford came full circle to regain the lead, feeding a delicious reverse inside ball to Tansey, whose pace took him clear before slipping the ball to Milner who dived over spectacularly.
Brown's grubber rolled into touch as Widnes pushed for a leveller, and after ignoring Betts' calls to kick for two from a penalty, Hanbury was held up a yard from the line on the last.
And after Ah Van dragged his penalty wide, Castleford hung on for a precious two points.
VIEWS FROM THE DRESSING ROOM
Castleford interim coach Danny Orr said:
"I am a very relieved, happy man. It was a massive relief to win because it was very tense with two minutes to go. It is something for us to build on. I thought we defended really well in the second half to keep Widnes scoreless.
"Daryl Clark has been ill and has not trained all week. He had to go to hospital. My idea was to start with Adam Milner and then get half an hour into the game and bring Daryl on to speed us up a bit. And then for the last 20 minutes bring Milner back on and move Clark to loose forward where he can still cause problems. I thought both of them played really well. They really got us going forward.
"James Clare has come in for a bit of criticism this year because he has made a few errors and he knows that, but I thought today he was probably one of our best players. It was an outstanding performance from the young kid so I was really pleased for him."
Widnes coach Denis Betts said:
"We are disappointed with our second half display. We got a little bit too cautious in the second period. We looked like a side who didn't want to lose rather than a side that wanted to go on and win the match.
"I thought Castleford fed off the crowd and they had nothing to lose. I didn't think it was a great game - it was exciting - but I didn't think we played that well. We were pretty average. We clicked into gear in the first half but then we just got caught up in the emotion.
"When Craig Huby made a couple of big shots for them when he came off the bench I think that they grew an extra leg. I thought he was inspirational to a lot of the energy they gained. I am really pleased for Danny Orr. I've known him a long time and he's come up with what we expected and what you thought would happen. He's got a response from the team.
"Castleford came out with passion and energy and we couldn't match that enthusiasm. We just lost the battle of emotion and attitude. Castleford fed off the crowd and they fed off each other really well."
Castleford: Tansey; Owen, Shenton, Thompson, Clare; Chase, Ellis; Mason, Milner, Huby, Holmes, Hauraki, Massey.
Replacements: Walker, Clark, Martin, Boyle.
Widnes: Hanbury; Flynn, Dean, Phelps, Ah Van; Brown, Mellor; O'Carroll, Clarke, Pickersgill, Winterstein, Leuluai, Gerrard.
Replacements: Kavanagh, Joseph, Lawton, White.
Referee; Richard Silverwood (Dewsbury).