I can only speak for my own kid, but when my five-year-old does it, she is clearly doing it because it feels good and is arousing -- she gets red-faced, she breathes hard, etc. If you ask her, she will tell you she does it because it feels good. We went through a few months of having to remind her not to do it in the living room, and enforcing it by turning off the TV or sending her off. Now she only does it in bed, and the only issue we've run into is when she wants to do that in the morning instead of getting dressed.
As to how to convince her -- this is a family rule. Some things are not public. we do not masturbate in the living room; we do not pick our noses in the living room; we do not floss our teeth in the living room. But all of these things are fine to do in private in an appropriate place (and then wash your hands, if necessary -- my daughter does it with her clothes on and just rubs against a stuffed animal or pillow, so we have't made a big whoop-de-doo about handwashing in her case). If you can either stop and watch the movie, or go to your room and masturbate there -- and then enforce it with the same methods you use for every other family rule. And going to the room isn't a punishment; you can pause the movie until she's ready to sit and watch with you guys, maybe the next night, so she doesn't miss out.