Gay was quickest out of the blocks after the race was delayed by two false starts and his first ever win over Bolt was sealed in comprehensive fashion.
The American powered home in a time of 9.84 seconds, well ahead of the out of form Bolt (9.97) who appeared sluggish by his own lofty standards.
“I was happy,” said Gay after the race. “But at the same time I still knew he wasn't 100 percent. When we're both running at 100 percent we'll be able to let the world know what we can do.”
For the Jamaican world record holder it was a return to the same track where he last tasted defeat two years ago to compatriot and world bronze medalist Asafa Powell.
“Stockholm is not my place, but I can't blame it on Stockholm. Tyson was much better prepared and in better shape and he was more focused I think," said Bolt.
Powell was forced to withdraw from Friday's Stockholm leg of the Diamond League due to a groin injury.
Powell, the former 100m world record holder, said: "I'm really upset. I was looking forward to challenging Usain and Tyson and was hoping that I would be in the race with a solid chance to win.
"But with the way I've been feeling it would be difficult to finish the race."
Bolt, Powell and Gay have not competed against each other since the final of the world championships in Berlin a year ago, where Bolt shaved 0.11sec off his world record of 9.69sec from the Beijing Olympics.
In Germany Bolt set a new time of 9.58, with Gay in second (9.71) and Powell third at 9.84.
At the Paris leg of the Diamond League Bolt confirmed his status as the fastest man over 100m setting a time of 9.84 to beat Powell (9.91).
Stockholm was the 11th leg in the 14-event Diamond League series.