Borriello has been at Roma since 2010, but won the Serie A title with Juventus in 2012 during a loan spell in Turin.
He has amassed close to 100 career goals with teams including Milan, Juve, Genoa and Roma and has won seven caps for Italy.
Nocerino, who has 15 caps, joined Milan from Palermo in 2011 but has been used sparingly this season.
West Ham are currently in the Premier League relegation zone, a point from safety with 16 matches of the season remaining.
The London club announced the deals on their website, a day after having a bid for Scotland international striker Ross McCormack rejected by second-tier side Leeds United.