Hey there
Yes ofcourse you can definitely take your exam from cs even if you did your BTech from ece. This is a confusing among many students but many students take there exam from a different branch than there own.
Check eligibility for gate
https://www.google.com/url?sa=t&source=web&rct=j&url=https://engineering.careers360.com/articles/gate-eligibility-criteria/amp&ved=2ahUKEwjq94zUjKPkAhWLdn0KHWohB1gQFjACegQIDhAJ&usg=AOvVaw1udu7YYL_zKa8I_bkLpLEy&cf=1
Good luck
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile