The incident took place Monday when the woman went to meet her husband, detained in connection with a case, in Sumerpur police station of Hamirpur district.
Hamirpur Superintendent of Police Virendra Shekhar told IANS that following a complaint by the woman, a first information report was lodged and the station house officer (SHO) was arrested Wednesday.
Shekhar assured the woman that no one would be spared if found guilty.
Three other policemen named in the complaint are absconding and a search is on to arrest them, officials said.
Ten cases of rape are being reported in Uttar Pradesh everyday on an average
The woman told senior officials a sub-inspector and three constables gangraped her when she went to the police station to meet her husband Monday.
Crime against women have witnessed a sudden spurt in the state and on an average, 10 cases of rape are being reported every day.
BJP state spokesman Vijay Bahadur Pathak said the incident was another example of lawlessness in Uttar Pradesh.
"Women are not safe in their homes, out in the fields and now not even inside police stations," he said.