The best way is to use baking spray instead of cooking spray. However, you could also grease the pan with coconut oil or dairy-free butter and dust it with gluten-free all purpose flour.