Movie about a “dad” keeping his daughter captive in the house and not letting her leave

I put dad in quotations becuase I do not remember if it was her dad or not. I vividly remember a scene where she sneakily gives a help me note to someone knocking on the door and the “dad” kills the girl who knocked on the door when he realizes. I also remember a showdown in the attic where she lights the house on fire. I’m not too sure on the last part though

Just a guess, maybe?:
“Girl in the Basement” (2021)

Or the earlier Room (2015):

Into the Dark S1.E2 Flesh & Blood?