It is a way of expressing need in Turkish. Bize bir ambulans lazim. Bana bir kalem gerek.
Bir Turkce sozluge ihtiyacim var. - Here what is needed takes the dative case and 'ihtiyac' forms a genitive construction 'benim ihtiyacim'
Also, personal pronouns have locative case when expressing possession. Ex. Bizde araba var.
Just with this sentence I rememberd that gerekmek needs the dative (and apaprently lazım does the same). But in the Aorist-skill there are plenty of sentences without a word with the dative suffix. For example: We need to have fun tonight! - Bu gece eğlenmemiz gerekiyor! Is there a rule for it or what am I missing?