Dramatic finish sends Carlisle on to state tourney