The match started with the home team taking the play to Saints and Kyle Moran made a couple of good saves from John Smith and Chris Ireland.
St Andrews United enjoyed a period of dominance but two missed chances proved costly.
Evan Stanfield was denied by Dion Gear when he only needed to beat the goalkeeper from a one-on-one situation and Matty Hutchison hit the post from a Jake Grady cross.
Fife beach will host Home International rowing competition
East Fife goalkeeper Jude Smith signs for Newcastle United
Kirkcaldy Half Marathon route map revealed as countdown begins
Fife Flyers: All the signings so far for the 2022-23 ice hockey season
Rory McIlroy and his dad to play in Alfred Dunhill Links in St Andrews
United were the better team at that point but Kirkcaldy promptly upped a gear and took the lead in the 23rd minute when Jay Bridgeford raced on to a clever pass from Chris Price before rounding Moran.
The hosts took control of proceedings and Hutchison limped off the park in the 41st minute following a poor tackle by the YM left back.
Moran also made two further saves to keep his side in the contest but referee Gamble pointed to the spot in the 44th minute as veteran defender Grame Findlay fouled Ireland in the box for a clear penalty.
Ryan McEwan took the kick and he smashed the ball past Moran.
Bridgeford and Smith went close at the start of the second-half before Smith capitalised upon a defensive mix up to make the score 3-0 in the 55th minute.
United manager Barry Cockburn made changes by introducing Jason Penman, Cammy Sneddon, Scott Russell and Adam Davidson for Nik Rendall, Findlay, Ross Cunningham and Lewis Sawers.
Saints won the the opportunity to pull a goal back from the penalty spot when Gamble spotted pushing in the home box by Scott Warrender. Grady calmly converted from 12 yards to make the score 3-1. Jason Penman and Ross Farquharson received late red cards for comments made to the referee.