Only a deflected strike by Tommy Miller and then a goal right at the death by Ian Westlake saw the Coca-Cola Championship side home after a distinctly unconvincing display.
Ipswich started brightly and Dean Bowditch fired over inside the first minute before a Richard Naylor header from Westlake's corner was parried away by Brentford keeper Stuart Nelson.
Alex Rhodes had a deflected effort saved by Lewis Price - making his home debut - before Pablo Counago headed home a Scott Mitchell cross, only for referee Paul Taylor to harshly rule it out for a push.
Having survived the early pressure, Brentford grew in confidence although they rarely threatened the Ipswich goal.
Bowditch had a shot tipped round the post by Nelson before Price had to jump to catch a firmly struck Ryan Peters drive.
The second half was even less lively, with Mitchell, substitute Shefki Kuqi and Deon Burton all blazing well over in rare efforts at goal.
Town finally broke the deadlock after 73 minutes when Darren Bent crossed for Miller to shoot from just inside the area. As he shot, Jay Smith tackled him, but the ball looped over the stranded Nelson.
With three minutes to go, Price dropped a flicked Scott Fitzgerald free-kick and Michael Dobson's touch sent the ball across goal, just in front of stretching substitute Isaiah Rankin.
Rankin came even closer in stoppage time, his flicked header forcing Price into a superb diving save.
From the corner Brentford keeper Nelson came up, but when Price caught it and launched it downfield, Westlake out-ran the covering defence to run the ball into an empty net.