Livingston leapfrogged Cowdenbeath following a convincing win at Almondvale Stadium.
Cowdenbeath took the lead 16 minutes in, Kane Hemmings tucking a right-footed strike into the bottom left-hand corner.
Livi levelled four minutes before half-time when Callum Fordyce rose to head Martin Scott's cross past Grant Adam.
Fordyce doubled his tally after 59 minutes, heading home Stefan Scougall's floated corner.
Andrew Barrowman added a third after 71 minutes when he met Martin Scott's pass with a sweet strike.
Substitute Mark Burchill added a fourth, slotting home Barrowman's 81st-minute pass to register his first goal for the club, and Fordyce completed a hat-trick of headers four minutes from time.
Livingston: Jamieson, McDonald, Mensing, Donaldson, Fordyce, Jacobs (Wilkie 84), Scougall (Burchill 76), O'Brien, Scott, Barrowman, McNulty (Denholn 77).
Subs Not Used: Rutherford, Walker, Mullen, Lander.
Goals: Fordyce 42, 60, Barrowman 72, Burchill 82, Fordyce 87.
Cowdenbeath: Adam, Brett, Armstrong, O'Brien, Adamson, Milne (Morton 65), Stevenson, McKenzie (Russell 65), Wedderburn, Robertson, Hemmings.
Subs Not Used: Flynn, Cowan, Miller, Callaghan.
Booked: O'Brien, Hemmings, Brett, Wedderburn.
Goals: Hemmings 17.
Ref: Craig Charleston