"It's an interesting time when you/your child leaves home for uni'.
It's when your child is no longer dependent on you for the basic necessities of life, and the cracks in your relationship can show in a way you are unprepared for."
I think you've got something there @mbosnz , about the cracks in the relationship showing and OP's sister being unprepared for that.
The cracks were created when the niece was just 15 and OP's sister met her now-partner, who "was staying over most nights within weeks so almost living there and then properly moved in after about 15 months." So from aged 15 onwards mum's boyfriend was "almost living there" and we have no idea what that was like for the niece. Even if he had been the kindest and most respectful man in the world, he was a stranger (to the niece) entering their two-female home and changing the dynamic of niece's home life - at a pretty formative time in her life. GCSEs and A levels and finding your feet in romance/attraction, the mid-teens are a pretty stressful part of every girl's (and boy's) life.
And then add to that fracturing of the home dynamic the apparent lack of concern by the mother for the daughter where they had previously "had a good relationship". Now, the daughter removing herself from this new uncomfortable home dynamic and to the comfortable wider family dynamic of her aunt's house via 'sleepovers' is seen by the mother as "just what teens did with their cousins and not to do with her being upset with the new partner living with them." For me, that inability/unwillingness to acknowledge her daughter's unhappiness is one huge crack in their relationship - and all the mother's own work to boot.
Now the mother has moved from unconcern ("I spoke to my sister about it at the time but she told me my niece was fine and it wasn’t my business") to anger ("My niece came to us last week and my sister is angry") and is trying to exert control over her daughter's life ("My sister thinks I should tell her that she can’t stay with us").
I think @Tryagain26 put her finger on it with her observation "It's also telling that the mother was perfectly happy for her daughter to stay in her university town over the summer but she doesn't want her staying with her Aunt. Is that because of how it looks?"
It is precisely because of how it looks, because it casts those cracks in the relationship into huge relief. Questions could be asked (by friends, neighbours, acquaintances), questions such as 'why is your daughter staying with your sister and not you?'. A question she is now having to ask of herself, and she's very much avoiding answering herself truthfully, she's totally in denial that it could be anything to do with her past behaviour.
Her daughter staying in her uni town, she could ignore those cracks - her daughter staying with her sister, not so much. And that's why she's angry. Because she can no longer ignore the cracks, cracks that she created.
And her daughter has the measure of her, hasn't she?
"My niece told me that she feels like she hasn’t had a mum for years and she has dealt with it, moved on and made a life for herself. She says her mum is only bothered now because she’ll feel embarrassed that she is staying with us, but didn’t have a big problem with her not having much contact when she was staying in her uni city for holidays."
"I’m going to let her stay but going forward what would you do?"
I would do exactly what you are doing, @ShadowShapes . Welcome your niece into your home, give her the 'home base' that every one of us needs. As for her relationship with her mother, there is nothing you can do, nothing you should do either. Those cracks will remain for as long as your sister insists she didn't fuck up five years ago and continued to fuck up ever since.
Currently, you "see my sister, her partner and my nephew regularly ... although I don’t know what will happen now as my sister obviously isn’t happy with my decision to let my niece stay with us." All you can hope for is that your sister doesn't make another bad decision here. She may be happy to pretty much erase her firstborn from her life ("didn’t have a big problem with her not having much contact when she was staying in her uni city for holidays") but she has no right to insist that you should do the same. If she decides to erase the rest of her family from her life instead, there's really nothing you can do until/if she realises her mistake. ((hug))