I don't know about separating just the female into the 5 gal. IMO I would put a lot of plants(fake/real) and decor for the fry to hide in. leave the momma fish to do her thing in the main tank. Around the time you think fry will be coming, I would put something over the filter intake(sponge or pantyhose) so that the fry won't get sucked up before you can save them. Use the 5 gal. as a fry tank with lots of places to hide and have something over the filter tank to prevent suction of fry. All I have is a 1gal. with an under gravel filter for my fry. If I had a 5 gal. I would do what I just stated. I hope this helps.
What I'm planning to do is to add a pre filter mesh, add lots of fake plants, and after the momma fish gives birth put her back in the 20 gallon so she won't eat the fry.