When knocking on someone’s door or waiting outside someone’s house then face to the side and don’t face the door. A person may see that which he isn’t supposed to see.
This also applies to when someone is texting next to you; don’t try to read it.
Lowering the gaze is supposed to be done not just from the opposite gender but also worldly things which make one want them, for example cars, houses and so on. This point was mentioned by some of the scholars of the past and Allah Knows Best.