Leyton Orient’s involvement in the FA Cup is over for another season but an improved second-half display saw them give Gillingham a good examination before the League One side were able to secure a 2-1 first round victory.

The O’s struggled to lay a glove on their opponents and were fortunate not to be trailing to more than Josh Parker’s 20th-minute opener.

But Steve Davis’ half-time team talk, coupled with a switch to 4-1-3-2 shape, had the desired effect as the visitors increasingly took the game to the Gills after the break, albeit without ever looking totally secure at the back.

They had their chances to get back on terms, none better than a Jamie Sendles-White header from a corner, but their failure to capitalise looked to have ended their hopes when Tom Eaves put the home side two goals to the good.

That deficit was to quickly halved as a James Dayton free-kick from out wide went in, but the O’s were unable to create another good opportunity to force a replay during a fractious finale which saw Joe Widdowson sent off for a second yellow card.

Davis made three changes from the team which drew 2-2 at Wrexham last time out. Mark Ellis and James Brophy were ineligible under the terms of their loan moves, while Dan Happe also missed out. Their places were taken by Widdowson, having recovered from his hamstring problem, Myles Judd and Michael Clark.

After a predictably frenetic opening, it was the hosts who had the first sight of goal when Mark Byrne whipped in a quickly taken free-kick from the right, but Eaves couldn’t get over his header and the ball sailed harmlessly over.

Charlie Grainger was forced into his first save of the contest in the ninth minute, dropping to his left to hold a Parker shot from the edge of the 18-yard box, but the opportunity had arisen as the result of a fine run from Sean Clare, who had weaved his way forward from right-back.

Orient’s first real moment of promise came when a lofted pace in behind saw Macauley Bonne beat the Gills backline for pace, but keeper Tomas Holy raced from his line to clear just as the striker was shaping to lift the ball past him.

But the O’s were cut apart moments later when Martin’s pass found Eaves in plenty of space on the left side of the area, but the big striker was unable to get the better of Grainger after coming back inside to hit a right-foot shot.

That was a let off for Davis’ men but they were to be undone in the 20th minute when Elliott List drifted in a left-footed cross from the right and nobody picked up the run of Parker, enabling him to rise and plant a straightforward header past Grainger to make the breakthrough.

The hosts continued to threaten with their movement and invention in the final third; Eaves flashing a low ball across the six-yard box before a Parker cross almost picked out the head of Martin, coming in from the back post.

Gillingham’s tails were up and their opponents were finding it increasingly difficult to handle them, escaping again when Parker headed a Martin free-kick over at the far post after the home side’s play-maker had been fouled by Judd on the right.

Grainger was the first player to be booked in the 35th minute when he brought down Clare after coming charging out of his area, but the O’s saw off the subsequent danger from the free-kick, albeit after the ball had pin-balled around their penalty area.

The O’s were hanging on and were fortunate not to concede a penalty when, after their opponents attacked at pace on the counter, Widdowson looked to have caught List from behind as he pulled the trigger, but referee John Brooks – who had slipped over trying to keep up with play – ruled the defender had won the ball.

Although the visitors remained a goal behind going into the break, they did enjoy a rare period of possession in the opposition half in the closing few minutes of the first-half.

Davis felt change was necessary at the break, bringing on Alex Lawless for Clark and ditching three at the back in a favour of a 4-1-3-2 formation.

And it was the O’s who were to have the first opportunity of the second period when Dayton’s ball in from the left found David Mooney, who opted to try and lift the ball over Holy on the volley, only to get too heavier a touch on the ball and send it over the top.

Another half chance came and went three minutes later, albeit thanks to some opportunistic thinking as Jake Caprice hit a long diagonal ball up to Bonne, who took the ball on his chest before hitting a right-footed volley on the turn not too far wide of Holy’s right-hand post.

Orient were offering a threat and after a Dayton free-kick had been blocked and his follow-up also repelled, Romauld Boco chanced his arm from distance, but Holy was always behind the strike.

The home side made their first change in the 56th minute, with Scott Wagstaff coming on for List, but the game continued to be played in the direction of the Gills goal.

Caprice was getting an increasing amount of success down the right and it was from his cross that Bonne managed to hold off his man and stab the ball towards goal at the far post, with a combination of post and Holy’s fingers doing enough to keep it out.

The Gillingham keeper was to be extended again moments later when Mooney hit a dipping volley on the run from 30 yards out which would have dropped in had Holy not tipped it over. But it was from Boco’s resulting corner from the right that Orient really should have equalised as Sendles-White was presented with a free header. Although Holy deserves credit for making a fine save, if the O’s centre-half had headed the ball down he would surely have scored.

Still the pressure continued, with Holy forced to push over a well-struck Zain Westbrooke drive following another corner, before the O’s made a second change in the 69th minute as a striker replaced a midfielder, with Matt Harrold coming on for Boco.

Some of the momentum then went out of the visitors’ attacking play for a spell as Gillingham gained a welcome respite, which was to turn into clear daylight after 74 minutes.

A long ball forward to the left side of the area saw Eaves battle with Sendles-White. The O’s defender felt he was fouled, the referee disagreed and the big striker shook off his man to drill a low shot beyond Grainger to make it 2-0.

Sendles-White was booked for complaining while the scorer was to play no further part as he was replaced by Conor Wilkinson before play could restart.

But if the home side thought they had landed the knockout blow they were in for a shock.

With 12 minutes remaining the O’s were awarded a free-kick wide on the left. Dayton struck the set piece towards the near post where Mooney and Bonne were among those to attack it, but nobody got a touch as the ball went in at the far corner to make it 2-1.

The touch paper had been lit and after the Gills had completed their changes with Luke O’Neill coming on for Connor Ogilvie, it was to be ignited further as Dayton, Judd and the newly-arrived Wilkinson were all booked for their respective parts in a flare-up.

Harrold was to soon join them for scything down Luke O’Neill, before Sendles-White was in the right place to head a Max Ehmer volley off the line.

Davis threw on Ruel Sotiriou for the closing stages in place of Westbrooke, but it was the hosts who were finishing the stronger and a brave block was needed to repel a Parker shot on the turn.

Widdowson was to add his name to the yellow card collection with four minutes remaining for a foul on Wilkinson, but the O’s defender was not to see out the five minutes of injury-time – the linesman spotting a pull on Wilkinson as he looked to break through and Brooks reached for a red card.

Gillingham: Holy; Clare, Ehmer, Zakuani, Ogilvie (O’Neill 78); Byrne, Hessenthaler; List (Wagstaff 56), Martin, Parker; Eaves (Wilkinson 75). Subs not used: Arnold, Mbo, Chapman, Cundle.

Leyton Orient: Grainger; Clark (Lawless 46), Sendles-White, Widdowson; Caprice, Boco (Harrold 69), Westbrooke (Sotiriou 87), Dayton, Judd; Mooney, Boco. Subs not used: Sargeant, Pollock, Dalby, Clay.

Bookings: Grainger for a foul on Clare (35); Sendles-White for dissent (74); Judd for altercation (80); Dayton for altercation (80); Wilkinson for altercation (80); Harrold for a foul on O’Neill (82); Widdowson for a foul on Wilkinson (86); Widdowson for pulling back Wilkinson – sent off (90).

Attendance: 3,659 (818 away fans).

Referee: John Brooks.