The ballot result took Labour ministers by surprise and threatened to disrupt payments to hundreds of thousands of claimants in England, Scotland and Wales.
Mark Serwotka, head of the Public and Commercial Services Union, said: "The government tried to portray this as a political dispute and put enormous pressure on staff not to vote for a strike. They are concerned about safety and now they have voted to strike, the government must take their concerns seriously."
Employees voted by 16,770 to 14,659 on a turnout of just over 50% to strike unpaid for five days a month.
Some 3,000 staff in 57 offices have been taking industrial action for weeks over moves to scrap screens in all but a limited number of offices.
The government claims better training, cameras and security staff would reduce risks.
Negotiations are expected to resume but the two sides last night appeared to be far apart.
Alistair Darling, work and pensions secretary, said: "The PCS is split down the middle, with just one in four of those balloted voting for national strike action.
"This is a pointless dispute that is damaging to staff and customers. We will continue to do all we can to maintain benefit payments but a national strike will hit vulnerable people. The union must know that this will not be a pain-free dispute."