No, for this recipe, margarine does not work. Margarine is imitation butter, so the flavor and the way it cooks will not result in the same end product.