Reference: Fataawa Ramadhaan – Volume 2, Page 873, Fatwa No.860
Fataawa al-Lajnah ad-Daa.imah lil-Buhooth al-‘Ilmiyyah wal-Iftaa. – Fatwa No.6718
Question: Is the caretaker’s room or the room in which the Zakaah Committee meet in the masjid acceptable as a place to do i’tikaaf, keeping in mind that the doors to these [two] rooms are within the masjid?
Response: The rooms and the doors leading to them which are within the masjid are regarded as [within] the masjid. However, if the rooms were outside the masjid despite their doors being in the masjid, then they (the rooms) are not regarded as within the masjid.
And with Allaah lies all success, and may Allaah send prayers and salutations upon our Prophet Muhammad ﷺ and his family and his companions.