With their reply at 130-4, the Hertfordshire League hosts looked odds on to overhaul Odiham's 158-9.
But McGaughrin, pictured, ripped out Berkhamsted's middle-order with a spell of 4-26 which culminated in the last six wickets falling for 25 runs. Berkhamsted collapsed to 155 all out (Ryan Friend 41) and a surprise three-run defeat.
Earlier, Ed Ikin (28) eased Odiham to 64-1 before three quick wickets fell, leaving Liam Doran (22), Will Kettle (20) and Jack Malden pick up the pieces and steer the visitors to a competitive score.
Odiham's reward is an away tie against powerful ECB Middlesex County League side Richmond at Old Deer Park on Sunday, 1pm - a busy day for the club, with a National Village Cup tie at Hursley Park also on the agenda.