Leeds Rhinos ended a four-game losing run as Jimmy Keinhorst's hat-trick led them to a tight win over Castleford.
Leeds went ahead when debutant Thomas Minns squeezed over before Cas broke away to level through Weller Hauraki.
Keinhorst and Zak Hardaker put Leeds ahead but Cas were 18-16 up when Jordan Tansey scored either side of half-time.
But Keinhorst's own double, both laid on by Ryan Hall, put Leeds ahead before late scores from Joel Moon and Ian Kirke added gloss to the victory.
Leeds started much quicker than the Tigers and 18-year-old winger Minns gave them a third-minute lead, when he sneaked in at the corner after Jamie Ellis and Jordan Tansey had done well to deny the Rhinos twice already.
After Kevin Sinfield missed the conversion, the hosts continued to pile on the pressure, but Hardaker bought Hauraki's dummy and gambled on an interception, allowing the big former Rhinos second-row forward to run the length of the field and score, Ellis adding the extras.
Two tries in two minutes swung the game back Leeds' way.
First, centre Keinhorst, playing in his first game since a spell on dual registration at Hunslet, made a beautiful arcing run for half-back Rob Burrow who threw a clever dummy and sent the youngster in,
Full-back Hardaker then made up for his earlier error to run 50 metres and fly past a helpless Tansey.
Just as all the momentum was with the home side, full-back Tansey, another ex-Rhino, profited from Daryl Clark's great work up the middle to take a quick play-the-ball and go in under the posts, Ellis's straightforward conversion making it 16-12 to Leeds at the break.
Tansey scored a nigh-on replica just after the restart, with Grant Millington this time the battering ram as the Tigers went ahead for the second time in the contest thanks to Ellis's goal.
After Castleford's full-back seemed determined to take centre stage, it was Keinhorst who stole the show, completing his hat-trick by scoring two set-piece tries in five minutes.
On both occasions it was Leeds captain Kevin Sinfield with the high cross-field kick for England winger Ryan Hall to catch and off-load to the supporting winger and put the Rhinos firmly on top 28-18.
The game looked set for a tight finish when Cas prop-forward Craig Huby barged his way over and Ellis then took them within four points.
But Leeds prop Kirke and centre Moon both went over from close range to give the end result an unfair reflection on how close an encounter this West Yorkshire derby was.
VIEWS FROM THE DRESSING ROOM
Leeds Rhinos coach Brian McDermott:
"I don't think it was a great performance and the result doesn't fix everything up.
"I though Jimmy Keinhorst came in and did really well and I'm pleased for him because he has obviously been waiting for that chance.
"Thomas Minns scored a try too which would be a dream come true for him so it's a good night for the juniors."
Castleford Tigers coach Daryl Powell:
"I just thought we gave a little bit too much away and when the game goes quick, Leeds have the players that can punish you.
"The scoreline was a bit harsh but in Super League if you clock off, you end up conceding points.
"We got them a bit twitchy when we got to within four points but couldn't go on.
"We've got to learn some lessons and cut down on our errors."
FRIDAY NIGHT'S LINE-UPS
Leeds: Hardaker; Minns, Keinhorst, Moon, Hall; Sinfield, Burrow; Leuluai, Peacock Jones-Buchanan, Delaney, Bailey, McShane.
Replacements: Kirke, Sutcliffe, Singleton, Achurch.
Castleford: Tansey; Clare, Shenton, Thompson, Dixon; Chase, Ellis; Walker, Milner, Huby, Holmes, Hauraki, Massey.
Replacements: Clark, Millington, Fleming, Boyle.
Referee: Tim Roby.