John McDonnell has been accused of using “Machiavellian” tactics to secure influence over the future of the Labour party after he rejected Rebecca Long-Bailey’s preferred choice for deputy leader.

McDonnell, the shadow chancellor, announced his decision on Wednesday to back Richard Burgon over Long-Bailey’s ally Angela Rayner, despite being said to be Long-Bailey’s mentor.

Long-Bailey, a contender for leadership of Labour, and Rayner, are flatmates and running on an unofficial joint ticket; both formed part of Corbyn’s inner circle and describe themselves as socialists.

While McDonnell had said he would nominate Long-Bailey for leader, his decision to back Burgon, the shadow justice secretary – who, like Long-Bailey, is on the left of the party – has been described by one Labour source as a “slap in the face” for the latter.

The source said: “It looks like John McDonnell of old is back. Collegiate John that we saw in the last year has gone and we’re back to Machiavellian manoeuvring. It looks from the outside like there’s been a tug of war over the direction of Corbynism and the Rebecca Long-Bailey campaign, and John has not ended up being in charge and is seeing Richard as a road back to influence.”

The source claimed McDonnell had decided to switch to Burgon, the chair of the Socialist Campaign Group, to retain influence over the party after not landing an influential role in Long-Bailey’s campaign team, despite promoting her for years as a talented possible leader.

His endorsement for Burgon will also be a blow for the shadow equalities secretary, Dawn Butler, another strong Corbyn ally, who has also thrown her hat in the ring. All three hopefuls are chasing a similar pool of MPs for the required 22 nominations to get on the ballot paper.

A senior source close to McDonnell, responding to the claims, said: “John is supporting Richard because he is chair of the Socialist Campaign Group of MPs and John is a member of that.”

The pair are believed to be long-standing friends and have worked closely together for many years.

McDonnell said on Tuesday that he did not wish to get too involved in the leadership or deputy leadership race. “I’m trying to quietly drift into the role of an elder statesman making pompous statements every now and again,” he said.

The Socialist Campaign Group of 21 MPs is an organisation within the Parliamentary Labour party, and McDonnell was supported in his former bid to be party leader by the group in 2010.

Burgon, who has been MP for Leeds East since 2015, also secured the backing of another high-profile figure, the shadow home secretary, Diane Abbott, who is also a member of the SCG.

Earlier on Wednesday, hustings for those seeking the deputy leadership nomination were held in parliament for Labour MPs. Aside from Burgon, Butler and the shadow education secretary, Rayner, the contenders are Labour’s lone MP in Scotland, Ian Murray, the shadow sports minister, Rosena Allin-Khan, and the shadow Europe minister, Khalid Mahmood.

Murray was widely viewed as being among the best performers at the hustings. One MP backing him said: “I’ve nominated Ian. I thought it was really important to discuss Scotland and he’s the best person to have a view on that. He was analytical. It was nice to have someone reaffirm your decision.”

Questions fired at all six candidates during the hustings included queries about what lessons could be learned from the party’s election wins in 1946, 1964, 1974 and 1997.