The 30-year-old helped the Tynecastle club win promotion to the top flight last season following his second spell at Dundee United.
Capped twice by Senegal in 2009, Gomis has featured in 21 games for Hearts this season.
His departure was announced soon after Hearts signed former Cardiff and Wigan midfielder Don Cowie.
"Morgaro is at the stage where he wants to play regular first-team football every Saturday and with the depth of our squad it was something I couldn't guarantee," Hearts head coach Robbie Neilson told the club website.
Gomis won the Scottish Cup with Dundee United in 2010, moving on to Birmingham for two seasons before making a return to Tannadice in 2013.
Motherwell could also re-sign James McFadden, who had signed a deal until the end of January as he awaited news from the United States following a trial with Philadelphia Union.
Manager Mark McGhee said: "He was supposed to be going to America but that's fallen through so if he's going to stay around here, and if there's nobody else that steals him away from us, then he will be welcome to stay around here a bit longer."
Meanwhile, defender Craig Reid, 29, has been released from his Fir Park contract.
Motherwell have signed Hearts midfielder Morgaro Gomis on loan until the end of the season.