Electing to bat in a Cheltenham, Gloucester and Forest League match which was reduced to 30 overs because of a rain-delayed start, St Briavels were limited to 107-6.
Margetts finished with figure of 3-6 off six overs which included three maidens.
His 20 runs with the bat would also be the best for his side.
Rajesh S R took two wickets for seven runs in 3.3 overs.
His spell, which included two maidens, was cut short by a shoulder injury.
Matthew Spoor also claimed a wicket.
The bowlers on both sides could also count on good fielding.
A high point for Penallt was a full-length diving catch by Kamaal Mitha.
Margetts got an early breakthrough when he took two wickets when the home side was on 19.
Darryl Reynolds was caught for two by Myles Ruck and captain Stuart Williams went for a duck, caught by Mitha.
The visitors continued to make progress, reducing St Briavels to 33-5.
Despite the inroads that Penallt had made, they could not dislodge opener Will Peters.
Peters would go on to contribute 62 of St Briavels’ total of 107.
His undefeated innings came off 75 balls and included five fours.
The home side’s total was moved on by a partnership of 52 with Phillip Seabury.
Seabury was caught by Cameron Pardington, off Spoor for 15.
The St Briavels bowlers put the brake on the run rate from the start and had only 19 on the board after 10 overs.
It was in that over that Margetts was run out by a great throw from Stuart Williams.
With six overs left and with five wickets in hand, Penallt needed 30 runs to win.
But in the next over, Williams bowled Dai Richards and Myles Ruck and St Briavels sealed the win with a wicket in each of the next two overs to end the innings on 88.
Williams and Geraint Reynolds both finished with three wickets each
The defeat was the first reverse of the season for Penallt and Redbrook.
The side remain top of the table as second-placed Bream also lost.
St Briavels are third in the league,