San Francisco previously offered Gilliam a multi-year deal, which he turned down.
ESPN's Adam Schefter reported the deal is for one-year and $2.2 million. However, he was benched during the season as the coaching staff tweaked the inconsistent line often during the year.
But when Sowell struggled, Gilliam returned to the starting lineup for the final two regular season games as well as both playoff games. Gilliam joins Brock Coyle and Malcolm Smith on the list of former Seahawks who have made their way to San Francisco this offseason.
A 26-year-old native of Carlisle, Pa., Gilliam played collegiately at Penn State University from 2009-13, appearing in 27 games for the Nittany Lions.
The move alleviates pressure for the 49ers to add more depth along the offensive line via the NFL Draft.
Gilliam was tendered by Seattle prior to the start of the free agent signing period. The Seahawks have the right of first refusal, but they won't receive any compensation if they let Gilliam walk. The 49ers starting unit now looks to be Staley and Brown at the tackles, Josh Garnett and Zane Beadles at the guard spots and either Jeremy Zuttah or Daniel Kilgore at center.
With Gilliam in the fold, the Seattle Seahawks ranked 25th in the National Football Leagu (NFL) in rushing last season and allowed the sixth-most sacks.