Yes, necessary! The town is a location in this sentence so you can't use the class 3 noun mji but have to use the locative (class 16/17/18) noun mjini. (Another option would be to use a preposition with mji but I don't know which one.)
Mji wetu ni mkubwa. = Our town is big.
Mjini kwetu kuna nyumba nyingi. = There are many houses in our town.
No offence but I'm still not sure. -ni is a prepositional suffix used to indicate "in, on, near, by", etc. but I'm not sure on its use with "kutoka" which already suggests 'from'. I think it can be used but I'm not convinced it is necessary.
The -ni is not truly a prepositional suffix (or case suffix) but a derivative suffix that changes the noun class to one of the locative classes. It's a bit like how you can add ki- to the beginning of another word to form a diminutive or something similar, with the resulting change in noun class ... except that it's a suffix. In other Bantu languages such as Zulu, locative forms are generally created with both a change to the prefix and the suffix.
Note that mji is a class 3 noun, used with wa, wangu, wetu etc but mjini is not. It can be used with any of class 16, 17 or 18 concords (I think 17 is the most common with this, as shown in this example with the kw- form.)
Place names can inherently be used as locative nouns so there is no change when you say, for example, Anatoka Tanzania (There is no "Tanzaniani"!) or Ninaenda Nairobi but with most general nouns, there is also a locative form with -ni so you use them in these instances. There are some exceptions, such as very recent, unassimilated loanwords and some other random gaps (such as eneo, see below).
Looking up alitoka in a translation database (www.glosbe.com/sw/en/alitoka) you can see these examples. I used alitoka because I imagined it would be a common form of the verb in writing. Using kutoka would have had misleading examples as kutoka and toka can be used as prepositions.
I was probably a little overenthusiastic in saying it's absolutely necessary to use mjini, but in saying that, there's only one example here that goes against what I was saying.
LOCATIVE NOUN WITH -NI:
Adamu alitoka mavumbini = Adam came from the dust
Ferdinand alitoka nyumbani = Ferdinand left home
Wakati wa vita alitoka nyumbani = During the war, he left home
alitoka kitandani = she got out of bed
alitoka mbinguni = he left heaven
alitoka ofisini = she came out of the office
PLACE NAME, LOCATIVE WITH NO CHANGE:
Dennis alitoka Anchorage = Dennis left Anchorage
Yona alitoka Galilaya = Jonah came from Galilee
ambaye alitoka Australia na kuja Japan = "who left Australia and came to Japan"
alitoka Bucharest na kuhamia TirguMures = left Bucharest and moved to TirguMures
Nicu Palius alitoka Ugiriki = Nicu Palius came from Greece
Yesu alitoka Nazareti = Jesus came from Nazareth
INHERENTLY LOCATIVE NOUN MAHALI:
mahali ambako Yesu alitoka = the place Jesus came from
alitoka mahali alipokuwa amejikinga na kimbunga = he emerged from the place where he was sheltering from the hurricane
LOCATIVE INTERROGATIVE WORD WAPI:
alitoka wapi? = where did he come from?
LOCATIVISED WITH PREPOSITION OR PREPOSITION-LIKE WORD:
Yesu alitoka kwa Mungu = Jesus came from God
mwanamke alitoka kwa mwanamume = woman came out of man
alitoka katika mji wa Bethlehemu = came from the town of Bethlehem
alitoka nje = he went outside
alitoka katika chumba chake = he came out of his room
alitoka katika ukoo wa kikabaila = he came from noble lineage
alitoka katika mji mdogo ulioitwa Elkoshi = he came from a small town called Elkosh
alitoka katika kijiji cha Petrestii de Mijloc = he came from the village of Petrestii de Mijloc
alitoka katika familia tajiri = he came from a rich family
alitoka katika kabila gani? = which tribe was he from?
REGULAR NOUN THAT IS NOT LOCATIVISED IN ANY WAY:
alitoka nchi alimokuwa akiishi = left the country where she was living
alitoka eneo la Galilaya = left the area of Galilee
Baada ya kujua Yesu alitoka eneo gani = On hearing where Jesus was from
In the last examples, the word "eneo" appears twice and that's because this is one of those words that doesn't have an equivalent -ni word. (There is no "eneoni" as far as I've seen and possibly I should have put this with the place names.) The only one that doesn't fit what I was saying is the example with nchi. The word nchini definitely does exist (and is often used before country names to emphasise that the country is being used locatively).
So, yeah, I would have expected alitoka nchini or alitoka katika nchi or something.