Harry Forrester scored with a stoppage-time header to earn Rangers victory at Ibrox, sending Dundee back to the bottom of the Premiership.