Pearce returns to the club he made 50 appearances for after 16 years away, alongside Alan Irvine as Moyes' assistant coaches.
Earlier this year Pearce was tipped to take on the top job at Melbourne City before losing out to fellow Englishman Warren Joyce.
Adelaide United and Wellington Phoenix were also believed to have been interested in Pearce to fill their coaching vacancy.
Moyes took charge of West Ham after the sacking of Slaven Bilic this month and the Scot has moved to strengthen his backroom staff ahead of the Premier League trip to ninth-placed Watford on Sunday.
Former Manchester City and Nottingham Forest manager Pearce said he looked forward to helping 18th-placed West Ham improve their form.
"It's tough times at the moment but it's a fantastic opportunity for me. I'm really excited by the challenge," he said.
Moyes said striker Javier Hernandez, who is currently out with a suspected hamstring injury, need not fear being excluded as he was at Manchester United under him.
Hernandez started only six league games in Moyes' spell as Manchester United manager in the 2013-14 season but Moyes said the Mexican would get his opportunities at West Ham.
"He's a top goalscorer, a brilliant finisher," Moyes said. "It was difficult for him at United because I had Robin van Persie, Wayne Rooney, Danny Welbeck, Shinji Kagawa, so there was lots of competition.
"But he'll be treated the same here – if he's playing well and scoring, no problems. If he's not, it will be the same as the rest."