The 62nd-minute effort sealed an entertaining encounter for the home side in which both teams held the lead.
Jason Thomson opened the scoring for Dunfermline but the visitors found themselves 2-1 behind following a double from Paul Heffernan.
Dunfermline substitute Ryan Thomson netted an equaliser just after the break only for Kroca's wonderful effort to condemn them to their second straight league defeat.
Killie went close early on as Dean Shiels evaded the attention of Andy Dowie and slid the ball across the penalty box but nobody was on hand to slot it home.
Dunfermline midfielder Paul Burns then struck the base of post from the edge of the box a minute before the visitors grabbed the opening goal.
Andy Kirk's header crashed off the underside of the bar and Thomson was on hand to bundle the ball over the line.
Dunfermline could have doubled their lead minutes later when Kirk got on the end of David Graham's cross but Killie goalkeeper Cammy Bell tipped the ball past the post.
Pars boss Jim McIntyre was sent to the stand after a confrontation with fourth official Ian Brines after 20 minutes.
Kirk was proving to be a threat to the Kilmarnock rearguard and only a smart tackle by Liam Kelly denied him an opportunity to double the deficit.
Kilmarnock were struggling to regain a foothold in the match but were handed a glorious opportunity when referee Brian Winter awarded a penalty after Alex Keddie clearly felled James Dayton inside the area.
Heffernan made no mistake from the spot, sending Paul Gallacher the wrong way.
As the first half drew to a close Kilmarnock took the lead. Dean Shiels threaded a clever through ball to Heffernan who coolly slotted beyond Gallagher.
Kilmarnock boss Kenny Shiels replaced Craig Easton with Ryan Thomson at half-time and the change paid off within five minutes as he glanced home from Cardle's inch perfect delivery.
Thomson came close to doubling his tally just before the hour mark when he drilled an effort just wide of the post following David Graham's knockdown.
Kilmarnock restored their advantage on 62 minutes when Kroca delighted the home supporters with a low curling effort beyond Gallacher from the edge of the box.
The home side almost doubled their lead minutes later when Shiels weaved his way into the area and unleashed a stinging effort only to be denied by Gallacher.
The travelling supporters thought their side had drawn level with 10 minutes remaining when Kirk nipped in front of Bell to knock the ball into the net but the striker was adjudged to be offside.
Both managers made changes in the closing stages but despite Dunfermline's determined approach to the game it was the hosts who looked more likely to add to their tally.
Rory McKeown did well to drive into the box and he unleashed a stinging effort that forced Gallacher into another fine stop.
The impressive Shiels received a standing ovation from the Kilmarnock faithful when he limped off with minutes remaining to be replaced by Spaniard Jorge Galan.
Galan was unable to make an impact during his three minute appearance though and Kilmarnock comfortably held out for the three points.