The foursome of Gay, Trell Kimmons, Justin Gatlin and Ryan Bailey combined for an American record, passing the baton around the track in a time of 37.04.
The performance marked the first career Olympic medal for Gay.
The 4x100-meter relay was the second event of these Olympics for Gay who earlier in the week finished fourth at 100 meters, running the fastest time not to medal in Olympic history.
Team USA surpassed the previous national mark of 37.38, which was set Friday in the qualifying round of the 4x100-meter relay.
The team's time of 37.04 ties the second fastest of all-time behind the 36.84 run by Jamaica to win the gold Saturday.
Gay was making his second appearance at the Olympics.
Saturday was the final day of track and field competition at Olympic Stadium.
The closing ceremony for the 2012 Summer Olympics in London is scheduled for Sunday and will signal the end of the two-week global event.
The 2016 Olympics will be held in Rio de Janeiro, Brazil.