The Gills finished ninth last season, but are currently 17th in the table, 10 points off the play-offs, after 25 games of the campaign.
The Kent club have suffered back-to-back defeats, losing to Millwall on Friday and Oxford on Monday.
"This is obviously a difficult decision to begin 2017 with," chairman Paul Scally told the club website.
"However, the form over the past 12 months has not been as good as expected, and Monday's defeat [1-0 at home by Oxford] was the final straw."
Gillingham were challenging for promotion to the Championship in February last season, but just two wins in their final 15 league games saw them fall from second to mid-table, finishing five points behind the top six.
Their recent league form in 2016-17 has been inconsistent, with the Priestfield Stadium side winning four and losing five of their last 10 league games, which leaves them eight points above the relegation zone.
Edinburgh was appointed by Gills in February 2015 after leaving Newport County, and won 40 of his 102 games in charge.
"I have become close friends with Justin and his coaching staff, and that is what makes this decision even harder," added Scally.
"I'd like to express my gratitude to Justin for his efforts; he has tried extremely hard to turn things around."
Edinburgh's assistant David Kerslake and coach Wayne Hatswell have also been relieved of their duties.
League One side Gillingham have sacked manager Justin Edinburgh after less than two years in charge.