"Ego magistrum habeo." You need the accusative, not the nominative.
Here is a plain-English overview of what the cases are and how they work:
Latin cases, in English
Adjectives must agree in gender, number, and case with the nouns they modify, but they have their own declensions. Sometimes you get lucky and the adjective just happens to follow the same declension as the noun, but that is not a guarantee.