I don't think you can do this with the existing accordion. Luckily SXA is build very modular so you can do this with a custom version.
You need to create your own version of the accordion - create a copy of the rendering using the existing templates and view but you do need a custom controller.
For that controller, inherit Sitecore.XA.Feature.Composites.Controllers.AccordionController
.
You'll need a constructor like AccordionController(IAccordionRepository accordionRepository)
and your main logic should go into an override of the GetModel. You could call the (ootb) base version first to have your model filled:
protected override object GetModel()
{
var model = base.GetModel();
...
}
After the model has been filled, you can remove what is needed based on your custom requirements. You will find the composite items in Model.CompositeItems
.