Paulo Dybala and Mario Mandzukic gave the visitors a commanding 2-0 lead at the former Olympic Stadium, now known as the London Stadium.
Andy Carroll pulled a goal back and then headed the equaliser before Simone Zaza hit the winner for Juventus.
West Ham left Upton Park - their home for the past 112 years - in the summer.
They overcame Slovenia's NK Domzale 4-2 on aggregate in their first game at the London Stadium last Thursday to reach the Europa League play-off round.
West Ham's first Premier League game at the venue, which hosted athletics at London 2012, is against Bournemouth on 21 August.
West Ham marked the official opening of their new home with a 3-2 defeat against Italian champions Juventus in front of a 53,966 crowd.