Can a Will-o’-Wisp be put inside a bag of holding?

D&D 5e. My players were fighting their way through a swamp and, just like the question points out, they were fighting some will-o-the-wisp.

The fighter had a fun idea to put one of them inside the bag of holding. Since it was at the end of the encounter and the players were having none of it anymore, I thought it would be cool to let them pocket the wisp.

I’m looking for some rule or logic that proves this action wrong, but it’s fun to see that they got a creative idea to end the battle earlier. If anyone knows if the wisp gets away let me know why, I have some revenge plans for that little fella.