During the 2012–13 NHL lockout, Jágr played for his own team, Rytíři Kladno, in the Czech Extraliga. During the lockout, he scored 24 goals and 33 assists in 34 games and, before leaving Kladno for the Stars, was in second place of Czech Extraliga's scoring list. After the NHL lockout ended, he made his debut as a Star on 19 January 2013, when he tallied two goals and two assists in a 4–3 victory over the Phoenix Coyotes.
Jágr reached the 1,000-assist mark on 29 March 2013 in a game against the Minnesota Wild, becoming just the 12th player to do so and the first non-Canadian NHLer to reach the milestone.
On 2 April 2013, Jágr was traded to the Boston Bruins in exchange for Lane MacDermid, Cody Payne and a conditional third-round pick in the 2013 NHL Entry Draft. He made his Bruins debut on 4 April, scoring the lone goal in Boston's 1–0 win over the New Jersey Devils, and with his second Bruins goal, the first scored in a 3–0 shutout over the Florida Panthers on 21 April 2013, Jágr tied the record for the most game-winning goals in an NHL career (118), previously set by Phil Esposito.
On 22 July 2013, Jágr signed a one-year contract with the New Jersey Devils; the contract included $2 million guaranteed and another $2 million as an incentive bonus if Jágr was to play in at least 40 games. Jágr, at age 41, hoped to help the Devils overcome the loss of Ilya Kovalchuk, who had previously departed for the KHL. Jágr scored his first goal as a Devil on 7 October 2013 in a 5–4 shootout loss to the Edmonton Oilers. The goal came on the 23rd anniversary of his first NHL goal which, coincidentally, was against the Devils.
On 21 November 2013, Jágr tied Gordie Howe's record of game-winning goals with 121, with his 690th goal, which tied him in ninth place (with former teammate Mario Lemieux) for all-time goal-scoring leaders. On 20 December, he scored his 693rd goal, putting him in eighth place over Steve Yzerman. A day later, Jágr tied Mark Messier for seventh place in NHL history for goals scored with 694. Later in the season, on 14 January 2014, he scored his 695th goal, passing Messier, putting him 14 goals away from passing Mike Gartner. On 1 March, Jágr scored his 700th career NHL goal as the Devils won 6–1 against the New York Islanders at Nassau Veterans Memorial Coliseum. On 8 April, near the conclusion of the Devils' season, he was awarded the New Jersey Devils MVP Award at their annual team awards ceremony. He scored two points in his final game of the season (two assists in the third period), surpassing Gordie Howe for eighth place on the NHL's all-time list for career assists and tying Steve Yzerman for sixth on the all-time points list at 1,755. Jágr finished the season as the team's leading scorer, with his highest points total in a season since 2007–08. Jágr's play led the Devils to re-sign him to another one-year contract on 30 April. He became the joint sixth-highest scorer in NHL history in November 2014 after scoring his 708th NHL goal for the Devils against Boston. On 8 December, in his 1,500th NHL game, he moved ahead of Marcel Dionne for fifth place on the NHL's all-time points list with 1,772. On 3 January 2015, in a game against the Philadelphia Flyers, Jágr became the oldest player in NHL history to score a hat-trick at 42 years and 322 days. The record was previously held by Detroit Red Wings defenceman Nicklas Lidström.