This is the second time Holden has been traded since the 2016 offseason, when the Colorado Avalanche moved him during the draft for a fourth-round pick the next year.
Holden, who will be an unrestricted free agent after the season, has three goals and nine assists this season. Both numbers are down from his career highs of 11 goals and 23 assists during his first season in New York in 2016-17.
Earlier this month, the Rangers hinted in an open letter that major changes could be coming as the franchise sought "young, competitive players that combine speed, skill and character" while admitting that the team could lose some "familiar faces."
O'Gara appeared in eight games for the Bruins at the start of the season. He has spent most of 2017-18 with the AHL's Providence Bruins, posting two goals and six assists in 43 games.
The Bruins entered Tuesday in a tight race with the Tampa Bay Lightning for first place in the Atlantic Division. The Rangers are last in the Metropolitan Division.
Information from ESPN's Emily Kaplan and The Associated Press was used in this report.