Bohemians hold the advantage after the first leg of this Champions League encounter thanks to a second-half Killian Brennan header at a wet and blustery Dalymount Park.
TNS had several chances to get a vital away goal but Bohs will be quietly confident of getting a result in the return game next week.
The winner came on 66 minutes when Brennan rose highest to meet Paddy Madden’s cross and powered his header past TNS goalkeeper Paul Harrison following a period of intense Bohs pressure.
TNS, sporting green and white hoops like Bohs’ bitter rivals Shamrock Rovers, started well on the soggy Dalymount surface.
The Welsh champions played three up front and packed the defence and midfield when Bohs were on the offensive, and proved creative enough to suggest that they were not the pushovers some had expected.
Matthew Berkeley had a shot for the visitors from a good angle on eight minutes but dragged the low drive wide of Barry Murphy’s right hand post - though the offside flag had been raised.
Bohs lacked the cutting edge they had shown in recent league games with several passes not reaching there intended target and not everyone on each other’s wavelength.
A case in point came on 18 minutes when Madden got on the end of a long ball and headed it into the box. There was no Bohs man there to capitalise but the four TNS defenders tidied up.
Madden then had a half-chance on 21 minutes but Steven Evans stuck a leg out to block, while after 23 minutes, Harrison caught a Brennan cross before the inrushing Madden could get a head to the ball.
Evans then blocked a Raffaele Cretaro effort at the far post on 28 minutes as Bohs began to find themselves.
Christopher Sharp should have put TNS ahead on 36 when he met Craig Jones’ cross but he rifled his shot wide with only keeper Murphy to beat. Jones cannoned another shot off target on 39 minutes.
In a barnstorming end to the half for Bohs, Madden played a one-two with Cretaro on but shot wide from inside the area. Madden and Conor Powell both had shots before the break but Harrison saved both.
After the break, Scott Ruscoe fired wide for TNS after a quality build up involving Sharp and Matthew Williams after 49 minutes.
Daniel Holmes then looped an inviting ball around Paul Keegan in the 50th minute and slammed a ball through the packed goalmouth. All it needed was a touch to divert it past Murphy but the ball coasted past to safety.
Bohs almost took the lead on 59 minutes when Madden connected with Brennan’s through ball but Harrison dashed out and blocked. Madden then headed wide from six yards moments later when the ball was returned.
Bohs were improving minute by minute and took the lead on 66 minutes. Madden was the provider this time and Brennan met the cross and headed past Harrison at the right post.
Mark Quigley nearly made it 2-0 in the 82nd minute with a rasping shot from 25 yards, but the ball struck the crossbar with Harrison beaten.
Harrison saved from Madden again in the 87th minute as Bohs finished the game on top.
Bohemians: Murphy, Heary, Powell, Oman, Shelley, Brennan, Keegan, Higgins, Quigley, Madden, Cretaro (Byrne 75).
TNS: Harrison, Holmes, Marriott, Baker, Evans, Ruscoe, Hogan, Jones, Williams (Darlington 83), Sharp, Berkeley (Wood 77).
Referee: H Bas Nijhuis (Ned).