Financial, Cost and Management Accounting
Cost accounting is a sub-set of the more general discipline of Managerial accounting, in the same way that Tax accounting is a sub-set of the more general discipline of Financial accounting. So the scope of managerial accounting is much broader than the scope of cost accounting.
Where Managerial accounting helps managers in strategic decision making, devising planning, risk management and the development of performance management systems for the entire organisation, Cost accounting systematically records and analyses the costs of material, labour, and overheads in relation to the production of goods/services. It can also be used in non-manufacturing entities as explained by in the comments. So while managerial accounting focuses on assisting in broad-based management decision-making, Cost accounting focuses specifically on cost ascertainment, control and reduction.
While cost accounting uses the specialised tools of job costing, process costing, standard costing, activity-based costing, throughput analysis, marginal costing, cost-volume-profit analysis, uniform costing and inter-firm comparison, Managerial accounting adds organisation-wide tools like balanced scorecard, customer profitability analysis, rolling forecasts, ratio analysis, funds flow statement and statistical analysis.
Both the Cost and Managerial accounting streams are not a legal requirements and are not generally involved in the generation of financial statements. However, cost accounting is often used to help determine the valuation of inventory (raw materials, Work In Progress, finished goods) for the organisation's financial reports.