The bill was approved by 57 votes to 55 in its second reading, reported news agency ATS.
The new rule bans anyone from covering their face in public if they present a security risk or threaten social or religious peace, a condition that will be evaluated on a case by case basis.
That could include women wearing the burqa and people covering their faces during demonstrations or protests or for criminal intent.
The bill also passed in its first reading in September, when opponents slammed the move, saying it was superfluous and unsuitable.
Writing in the St Gallen Tagblatt at the time, editor Andri Rostetter criticized the law's implication that the authorities must make an “instant assessment” as to whether a person who covers their face is a threat.
“When this is the case, nobody knows. Not the police, who must apply the law... Certainly not the cantonal parliament, which has passed the law.”
In April the St Gallen government said it was against a complete ban on the burqa, feeling there was no public interest in doing so since the only women in the canton wearing the garment were tourists.
Last year Ticino became the first Swiss canton to implement a ban on wearing the burqa or niqab in public, with no exceptions for tourists.
Earlier this year the canton of Glarus refused a law banning face coverings, while the Swiss federal parliament also rejected a proposal for a similar nationwide ban.
However the issue is likely to go a federal referendum after a popular initiative on the subject gathered the required number of signatures to push it to a public vote.
The initiative goes further than St Gallen's new rule in that there is no assessment of risk -- instead it proposes a general ban on covering the face in public, apart from certain exceptions for health, safety or the weather.
The potential new law would also ban anyone from forcing another person to cover their face because of their gender.