However Ian Madigan kicked over 11 points for the hosts before Connacht, having lost replacement Ronan Loughney and Marmion to sin bins late on, were finally seen off by a 77th minute penalty try.
And O'Connor insists pushing for the late try - instead of opting to take the lead by kicking a penalty between the posts - deflated a defiant Connacht.
"It was brutal," O'Connor said. "We had dominance and the way the game was going you had to get pay out of your dominance.
"I think that sequence led to the scrum pressure which led to us getting penalised but ultimately that changed the mentality of our blokes and their blokes.
"They got a couple of blokes in the sin bin, led to the penalty try and that wins you the game."
Connacht frustrated Leinster for large periods of the game and Lam is adamant their tough approach was instrumental in so nearly grabbing a surprise win.
"We played some rugby but rugby is also about defence and against a team that scores a lot of tries we needed to get in their faces and we did that very well," he said.