For accuracy in the 5min range you have to consider 'which' sunset.
Do you want the time the bottom of the sun touches the horizon or the time the top of the sun passes below the horizon?
It takes 2mins for the sun to cross the horizon.
Below the 1min level you also need to take into account atmospheric refraction.