You are allowed to write GATE exam in 4th year to enable you not to waste/wait for another year to join M.tech. But, before joining in M.tech , you must produce proof that you passed your B.tech. So, you are not allowed to join M.tech without passing B.tech. You cannot give GATE in your 3rd year. Also in GATE some of the subjects would be unknown to you and you will study them in 4th year