Motherwell drop out of the Scottish Premiership top six despite scrapping back from two goals down to draw against St Mirren.