Yes, the novel is at least partly inspired by a real life event. In 1922 the newspapers were full of a murder story that had happened in New Jersey, not very far from New York where The Great Gatsby is set.
A married woman called Eleanor Mills fell in love with a married man, a wealthy clergyman called Edward Hall. Her husband found out and shot both of them dead. This story was the basis for the violent shooting that ends The Great Gatsby, though of course the circumstances are very different.
There is also a more general real life inspiration for the novel; F. Scott Fitzgerald, the author, was very familiar with the wild and glamorous lifestyle enjoyed by the rich people of Long Island, and elements in the novel like Gatsby's sumptuous parties are partly drawn from those of real life millionaires of the 1920s.
You can read more about the background to The Great Gatsby here.