Dublin's greater scoring threat proved crucial in an entertaining game at Parnell Park.
The Dubs were rocked early on when Niall O'Brien's speculative shot from 25 metres squirmed under Cormac Ryan.
Aonghus Clarke and O'Brien added points but Dublin began to monopolise possession with points from Cormac Costello, Paul Winters and Ciarán Kilkenny bringing the sides level.
Further points by Aodhán Clabby, Conor McHugh and Emmet Ó Conghaile put Dublin ahead by 0-11 to 1-3 at half-time.
They soon stretched their lead to eight, but David Higgins goaled for the visitors, who soon reduced the deficit to two points. But Brian McCarthy pushed Dublin three ahead before fellow sub Oisín O'Rorke fired home a late goal.
Scorers -- Dublin: P Winters (1f), E Ó Conghaile 0-3 each, O O'Rorke 1-0, C Costello, C Kilkenny, C McHugh, A Clabby (1f) 0-2 each, G Whelan, B McCarthy 0-1 each. Westmeath: N O'Brien 1-2 (1f), A Clarke 0-4 (2f), D Higgins 1-0, D Lynch 0-1.
Dublin -- C Ryan; E Lowndes, C O'Callaghan, S McClelland; C Crummy, J Desmond, M McCaffrey; G Whelan, C Cronin; E Ó Conghaile, C McHugh, C Kilkenny; C Costello, A Clabby, P Winters. Subs: O O'Rorke for Winters (h-t), B McCarthy for Whelan (50).
Westmeath -- C Lynch; T Gallagher, T Doyle, L Varley; D Fennell, C Scally, G Greville; D Lynch, D McCormack; P Fennell, A Clarke, R Greville; N O'Brien, D Higgins, N Kirby. Subs: J Boyle for Greville (35), C Glennon for McCormack (47).
Ref -- P O'Dwyer (Carlow).