Despite leading 19-0 until the final minute of the opening half, the Wizards struggled to overcome a spririted Llanharan outfit, who were fit and played withgreat heart.
Early tries by wing Richard Carter and centre David Hawkins were followed by a second from Hawkins with two converted by Jamie Davies.
Llanharan got on the board with an injury-time penalty by Wayne Jervis, but within five minutes of the restart, Carter went over again for Davies to convert.
Llanharan replied with a try by hooker Alan Williams and Jervis kicked a penalty, though Davies added a further Aberavon score with a penalty shot.
Aberavon were rocked again when flanker Ceri Jones went over for a last-minute try that Jervis converted from the touchline.
In Division One, leaders Maesteg won a local derby by 37-15 against Bridgend Athletic and scored five tries through wing Alun Brown (2), centre Paul Morgan, veteran scrum half Kevin Ellis and fly half Mark David.
David converted three and placed two penalty goals, but the Athletic responded with tries by Gavin Pound and Andy Tollentino and skipper Stuart Morris placed a conversion and penalty.
Warren Gatland and Sam Warburton look ahead to this week's crunch RBS 6 Nations tie against France, where the Wales skipper in particular is keen to make his mark, as Paris has proved a bleak place for him in the past.
Following their historic win over England, Wales Under 20 suffered a narrow, 36-34 loss to their Scottish counterparts last weekend, despite outscoring them by five tries to three. Watch the match highlights and reaction.
WRU TV go behind the scenes with the Wales squad as they put the final touches in place ahead of the clash against Scotland at Murrayfield. Follow the squad on their captain's run, the kickers visit to Murrayfield and Neil Jenkins' press conference