Sure, if you're facing Klingons.
There are very few actual incidences of tribal opponents, even with a massive numbers advantage, defeating formed and organized troops with decent cover.
The Zulu were regularly defeated by the Boers, even when the Boers were using muzzleloaders. That continued for them, and the Matabele even as they got firearms of their own.
It was much the same with the Plains Indians. The Wagon Box fight, Adobe Wells etc.
Being warriors rather than soldiers, and with a leadership more of consensus than of discipline, they often lacked the will and ability to push home attacks against the massive casualties involved. Oftentimes afterward the surviving defenders stated they could not have held against one more push.
Heck, even soldier vs. soldier, a sufficiently stout defense can win the battle of morale against odds and materiel. Little Round Top springs to mind.
As the Klingon maxim states, you can't win playing defense, but it can keep you from losing in the short term until you can go on the offensive. The indians (and Zulu and Matabele and 'insert tribe name here') couldn't play defense at all and lost.