If the situation is as you mentioned, it is lawful for you to marry your cousin, because
you were breastfed by your grandmother after you were two years old, which does not prevent your marriage to her, because Allah (Exalted be He) says (what means):
The mothers shall give suck to their children for two whole years, (that is) for those (parents) who desire to complete the term of suckling
The Prophet (peace be upon him) also said,
“No breastfeeding (creates the relationship of Mahram: unmarriageable relatives), except that which is in the (first) two years (of infancy).”
(Related by Al-Darqutny with (Part No. 21; Page No. 42) a Sahih [authentic] Isnad [chain of narrators])May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.