Have you not considered that Allāh knows what is in the heavens and what is on the earth? There are not three in a private conversation but that He is the fourth of them,1 nor are there five but that He is the sixth of them - and no less than that and no more except that He is with them [in knowledge] wherever they are. Then He will inform them of what they did on the Day of Resurrection. Indeed Allāh is, of all things, Knowing.
Translation: Saheeh International (English)
1 Through His knowledge of them and their secrets.
O Messenger! Do you not see that Allah knows everything that is in the heavens and everything on Earth; nothing within them is hidden from Him? No three people talk among themselves except that Allah (may He be glorified) is the fourth among them through His knowledge; nor do five people talk among themselves except that He may He be glorified is the sixth among them through His knowledge; nor any less or any more than these numbers, except that Allah is with them through His knowledge wherever they may be. No speech of theirs remains hidden from Him; He will then inform them of their actions on the Day of Judgement. Indeed, He knows everything; nothing is hidden from Him.